Files
MINGW-packages/mingw-w64-python3/0790-mingw-add-_exec_prefix-for-tcltk-dlls.patch
2015-09-21 15:47:39 +03:00

30 lines
870 B
Diff

diff -Naur Python-3.5.0-orig/Modules/getpath.c Python-3.5.0/Modules/getpath.c
--- Python-3.5.0-orig/Modules/getpath.c 2015-09-21 13:42:07.576667200 +0300
+++ Python-3.5.0/Modules/getpath.c 2015-09-21 13:42:35.020052800 +0300
@@ -788,7 +788,10 @@
bufsz += wcslen(zip_path) + 1;
bufsz += wcslen(exec_prefix) + 1;
-
+#ifdef MS_WINDOWS
+ if (_exec_prefix)
+ bufsz += wcslen(_exec_prefix) + 1;
+#endif
buf = PyMem_New(wchar_t, bufsz);
if (buf == NULL) {
Py_FatalError(
@@ -864,6 +867,13 @@
}
else
wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
+#ifdef MS_WINDOWS
+ if (_exec_prefix) {
+ /* Next add bin folder where the exe was found, for System DLLs e.g. tcl86.dll, tk86.dll */
+ wcscat(buf, delimiter);
+ wcscat(buf, _exec_prefix);
+ }
+#endif
#ifdef MS_WINDOWS
if (_path) {