Blob Blame History Raw
diff -rupN Python-2.7.13/Lib/ctypes/__init__.py Python-2.7.13-new/Lib/ctypes/__init__.py
--- Python-2.7.13/Lib/ctypes/__init__.py	2016-12-17 21:05:05.000000000 +0100
+++ Python-2.7.13-new/Lib/ctypes/__init__.py	2017-01-21 01:46:15.024516613 +0100
@@ -442,7 +442,9 @@ class LibraryLoader(object):
 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.dll" % _sys.version_info[:2], 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])