# DP: Do not add /usr/lib/pythonXY.zip on sys.path. --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -412,7 +412,9 @@ wchar_t *path = NULL; wchar_t *prog = Py_GetProgramName(); wchar_t argv0_path[MAXPATHLEN+1]; +#ifdef WITH_ZIP_PATH wchar_t zip_path[MAXPATHLEN+1]; +#endif int pfound, efound; /* 1 if found; -1 if found build directory */ wchar_t *buf; size_t bufsz; @@ -574,6 +576,7 @@ else reduce(prefix); +#ifdef WITH_ZIP_PATH wcsncpy(zip_path, prefix, MAXPATHLEN); zip_path[MAXPATHLEN] = L'\0'; if (pfound > 0) { /* Use the reduced prefix returned by Py_GetPrefix() */ @@ -586,6 +589,7 @@ bufsz = wcslen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; +#endif if (!(efound = search_for_exec_prefix(argv0_path, home, _exec_prefix))) { if (!Py_FrozenFlag) @@ -631,7 +635,9 @@ defpath = delim + 1; } +#ifdef WITH_ZIP_PATH bufsz += wcslen(zip_path) + 1; +#endif bufsz += wcslen(exec_prefix) + 1; /* This is the only malloc call in this file */ @@ -652,9 +658,11 @@ else buf[0] = '\0'; +#ifdef WITH_ZIP_PATH /* Next is the default zip path */ wcscat(buf, zip_path); wcscat(buf, delimiter); +#endif /* Next goes merge of compile-time $PYTHONPATH with * dynamically located prefix.