Skip to content

Commit 35c395a

Browse files
Alexpuxlazka
andcommitted
ctypes python dll
Co-authored-by: Алексей <[email protected]> Co-authored-by: Christoph Reiter <[email protected]>
1 parent d236925 commit 35c395a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/ctypes/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,9 @@ def LoadLibrary(self, name):
458458
cdll = LibraryLoader(CDLL)
459459
pydll = LibraryLoader(PyDLL)
460460

461-
if _os.name == "nt":
461+
if _os.name == "nt" and _sys.version.find('GCC') >= 0:
462+
pythonapi = PyDLL("libpython%d.%d%s.dll" % (_sys.version_info[:2] + (_sys.abiflags,)), None)
463+
elif _os.name == "nt":
462464
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
463465
elif _sys.platform == "cygwin":
464466
pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])

0 commit comments

Comments
 (0)