Files
MINGW-packages/mingw-w64-python3/0830-ctypes-python-dll.patch
2014-05-20 01:12:05 +04:00

15 lines
648 B
Diff

diff -Naur a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
--- a/Lib/ctypes/__init__.py 2014-05-19 09:19:37.000000000 +0400
+++ b/Lib/ctypes/__init__.py 2014-05-20 00:57:02.017600000 +0400
@@ -431,7 +431,9 @@
cdll = LibraryLoader(CDLL)
pydll = LibraryLoader(PyDLL)
-if _os.name in ("nt", "ce"):
+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 in ("nt", "ce"):
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
elif _sys.platform == "cygwin":
pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])