Skip to content

Commit

Permalink
ctypes python dll
Browse files Browse the repository at this point in the history
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
  • Loading branch information
Alexpux and lazka committed Jul 19, 2023
1 parent d236925 commit 35c395a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/ctypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ def LoadLibrary(self, name):
cdll = LibraryLoader(CDLL)
pydll = LibraryLoader(PyDLL)

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

0 comments on commit 35c395a

Please sign in to comment.