gh-149831: Fix ctypes DLL library name on Cygwin (#149832)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Carlo Bramini 2026-05-15 16:29:26 +02:00 committed by GitHub
parent a318a9d8d7
commit 50aff5fc5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -549,9 +549,11 @@ def LoadLibrary(self, name):
if _os.name == "nt":
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
elif _sys.platform in ["android", "cygwin"]:
elif _sys.platform == "android":
# These are Unix-like platforms which use a dynamically-linked libpython.
pythonapi = PyDLL(_sysconfig.get_config_var("LDLIBRARY"))
elif _sys.platform == "cygwin":
pythonapi = PyDLL(_sysconfig.get_config_var("DLLLIBRARY"))
else:
pythonapi = PyDLL(None)