summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/getpath.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c
index de1c6e3fbb..56775e9cb4 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -1492,6 +1492,16 @@ calculate_path(PyCalculatePath *calculate, _PyPathConfig *pathconfig)
}
}
+ if (pathconfig->stdlib_dir == NULL) {
+ if (calculate->prefix_found) {
+ /* This must be done *before* calculate_set_prefix() is called. */
+ pathconfig->stdlib_dir = _PyMem_RawWcsdup(calculate->prefix);
+ if (pathconfig->stdlib_dir == NULL) {
+ return _PyStatus_NO_MEMORY();
+ }
+ }
+ }
+
if (pathconfig->prefix == NULL) {
status = calculate_set_prefix(calculate, pathconfig);
if (_PyStatus_EXCEPTION(status)) {