Blob Blame History Raw
diff -rupN Python-2.7.14/Lib/ctypes/__init__.py Python-2.7.14-new/Lib/ctypes/__init__.py
--- Python-2.7.14/Lib/ctypes/__init__.py	2017-09-16 19:38:35.000000000 +0200
+++ Python-2.7.14-new/Lib/ctypes/__init__.py	2017-10-31 18:36:42.713180467 +0100
@@ -446,7 +446,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])