Blame 1010-ctypes-python-dll.patch

ddb6764
diff -rupN Python-2.7.13/Lib/ctypes/__init__.py Python-2.7.13-new/Lib/ctypes/__init__.py
ddb6764
--- Python-2.7.13/Lib/ctypes/__init__.py	2016-12-17 21:05:05.000000000 +0100
ddb6764
+++ Python-2.7.13-new/Lib/ctypes/__init__.py	2017-01-21 01:46:15.024516613 +0100
ddb6764
@@ -442,7 +442,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])