diff options
| author | Ned Deily <nad@acm.org> | 2014-06-02 08:05:29 (GMT) |
|---|---|---|
| committer | Ned Deily <nad@acm.org> | 2014-06-02 08:05:29 (GMT) |
| commit | b16619188633a22a924ea9497c55932cd03fdc44 (patch) | |
| tree | 5c6035b7c4335d374f20bf55d08c1415506727ec /Modules/getpath.c | |
| parent | e81c637bf8042660a76e0c9138c789369f880ccc (diff) | |
| download | cpython-b16619188633a22a924ea9497c55932cd03fdc44.zip cpython-b16619188633a22a924ea9497c55932cd03fdc44.tar.gz cpython-b16619188633a22a924ea9497c55932cd03fdc44.tar.bz2 | |
Issue #17095: Fix Modules/Setup *shared* support.
Original patch by Thomas Wouters.
Diffstat (limited to 'Modules/getpath.c')
| -rw-r--r-- | Modules/getpath.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c index c057737..f26b8e9 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -734,6 +734,11 @@ calculate_path(void) 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)); if (buf == NULL) { @@ -781,6 +786,15 @@ calculate_path(void) /* 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; |
