Files
MINGW-packages/mingw-w64-python3/1500-mingw-w64-dont-look-in-DLLs-folder-for-python-dll.patch
2015-09-21 15:47:39 +03:00

30 lines
1.1 KiB
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:36.358809600 +0300
+++ Python-3.5.0/Modules/getpath.c 2015-09-21 13:42:58.274461600 +0300
@@ -973,6 +973,17 @@
int
_Py_CheckPython3()
{
+ /* This does not work well with mingw-w64-python. First it tries to
+ * look up \python3.dll, which it won't (or should not) find. But the
+ * real problem is when Python is freezed by cx_Freeze. sys.prefix
+ * is then /, and Python tries to load /\DLLs\python3.dll, which makes
+ * windows try to load python3.dll from a network address, causing
+ * a several seconds long delay before proceeding. Since this code does
+ * not do anything useful in the current state, we might just as
+ * well return immediately. */
+#ifdef __MINGW32__
+ return 0;
+#else
wchar_t py3path[MAXPATHLEN+1];
wchar_t *s;
if (python3_checked)
@@ -997,6 +1008,7 @@
wcscat(py3path, L"\\DLLs\\python3.dll");
hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
return hPython3 != NULL;
+#endif
}
#endif