Blame 1010-ctypes-python-dll.patch

5117e73
diff -rupN Python-2.7.14/Lib/ctypes/__init__.py Python-2.7.14-new/Lib/ctypes/__init__.py
5117e73
--- Python-2.7.14/Lib/ctypes/__init__.py	2017-09-16 19:38:35.000000000 +0200
5117e73
+++ Python-2.7.14-new/Lib/ctypes/__init__.py	2017-10-31 18:36:42.713180467 +0100
5117e73
@@ -446,7 +446,9 @@ class LibraryLoader(object):
ddb6764
 cdll = LibraryLoader(CDLL)
ddb6764
 pydll = LibraryLoader(PyDLL)
ddb6764
 
ddb6764
-if _os.name in ("nt", "ce"):
ddb6764
+if _os.name == "nt" and _sys.version.find('GCC') >= 0:
ddb6764
+    pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2], None)
ddb6764
+elif _os.name in ("nt", "ce"):
ddb6764
     pythonapi = PyDLL("python dll", None, _sys.dllhandle)
ddb6764
 elif _sys.platform == "cygwin":
ddb6764
     pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])