Files
MINGW-packages/mingw-w64-python3/0830-ctypes-python-dll.patch
2018-04-16 10:51:53 +03:00

15 lines
686 B
Diff

diff -Naur Python-3.6.5-orig/Lib/ctypes/__init__.py Python-3.6.5/Lib/ctypes/__init__.py
--- Python-3.6.5-orig/Lib/ctypes/__init__.py 2018-03-28 12:19:31.000000000 +0300
+++ Python-3.6.5/Lib/ctypes/__init__.py 2018-04-16 09:54:40.786407600 +0300
@@ -428,7 +428,9 @@
cdll = LibraryLoader(CDLL)
pydll = LibraryLoader(PyDLL)
-if _os.name == "nt":
+if _os.name == "nt" and _sys.version.find('GCC') >= 0:
+ pythonapi = PyDLL("libpython%d.%d%s.dll" % (_sys.version_info[:2] + (_sys.abiflags,)), None)
+elif _os.name == "nt":
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
elif _sys.platform == "cygwin":
pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])