diff -r 82be592d764d Modules/getpath.c --- a/Modules/getpath.c Tue Jan 29 18:17:05 2013 +0100 +++ b/Modules/getpath.c Thu Jan 31 22:46:25 2013 +0100 @@ -726,6 +726,11 @@ bufsz += wcslen(zip_path) + 1; bufsz += wcslen(exec_prefix) + 1; + /* When running from the build directory, add room for the Modules + * subdirectory too. + */ + if (efound == -1) + bufsz += wcslen(argv0_path) + wcslen(L"Modules") + 2; buf = (wchar_t *)PyMem_Malloc(bufsz*sizeof(wchar_t)); @@ -776,6 +781,15 @@ /* Finally, on goes the directory for dynamic-load modules */ wcscat(buf, exec_prefix); + /* And, if we run from a build directory, the Modules directory (for + * modules built with Modules/Setup.) + */ + if (efound == -1) { + wcscat(buf, delimiter); + wcscat(buf, argv0_path); + wcscat(buf, separator); + wcscat(buf, L"Modules"); + } /* And publish the results */ module_search_path = buf; diff -r 82be592d764d Modules/makesetup --- a/Modules/makesetup Tue Jan 29 18:17:05 2013 +0100 +++ b/Modules/makesetup Thu Jan 31 22:46:25 2013 +0100 @@ -229,11 +229,7 @@ esac for mod in $mods do - case $objs in - *$mod.o*) base=$mod;; - *) base=${mod}module;; - esac - file="$srcdir/$base\$(SO)" + file="$srcdir/$mod\$(SO)" case $doconfig in no) SHAREDMODS="$SHAREDMODS $file";; esac