aboutsummaryrefslogtreecommitdiff
path: root/examples/python2.7/patches/no-zip-on-sys.path.diff
diff options
context:
space:
mode:
Diffstat (limited to 'examples/python2.7/patches/no-zip-on-sys.path.diff')
-rw-r--r--examples/python2.7/patches/no-zip-on-sys.path.diff52
1 files changed, 52 insertions, 0 deletions
diff --git a/examples/python2.7/patches/no-zip-on-sys.path.diff b/examples/python2.7/patches/no-zip-on-sys.path.diff
new file mode 100644
index 0000000..74ce88f
--- /dev/null
+++ b/examples/python2.7/patches/no-zip-on-sys.path.diff
@@ -0,0 +1,52 @@
+# DP: Do not add /usr/lib/pythonXY.zip on sys.path.
+
+--- a/Modules/getpath.c
++++ b/Modules/getpath.c
+@@ -380,7 +380,9 @@
+ char *path = getenv("PATH");
+ char *prog = Py_GetProgramName();
+ char argv0_path[MAXPATHLEN+1];
++#ifdef WITH_ZIP_PATH
+ char zip_path[MAXPATHLEN+1];
++#endif
+ int pfound, efound; /* 1 if found; -1 if found build directory */
+ char *buf;
+ size_t bufsz;
+@@ -520,6 +522,7 @@
+ else
+ reduce(prefix);
+
++#ifdef WITH_ZIP_PATH
+ strncpy(zip_path, prefix, MAXPATHLEN);
+ zip_path[MAXPATHLEN] = '\0';
+ if (pfound > 0) { /* Use the reduced prefix returned by Py_GetPrefix() */
+@@ -532,6 +535,7 @@
+ bufsz = strlen(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))) {
+ if (!Py_FrozenFlag)
+@@ -571,7 +575,9 @@
+ defpath = delim + 1;
+ }
+
++#ifdef WITH_ZIP_PATH
+ bufsz += strlen(zip_path) + 1;
++#endif
+ bufsz += strlen(exec_prefix) + 1;
+
+ /* This is the only malloc call in this file */
+@@ -592,9 +598,11 @@
+ else
+ buf[0] = '\0';
+
++#ifdef WITH_ZIP_PATH
+ /* Next is the default zip path */
+ strcat(buf, zip_path);
+ strcat(buf, delimiter);
++#endif
+
+ /* Next goes merge of compile-time $PYTHONPATH with
+ * dynamically located prefix.