Skip to content

Commit 50aff5f

Browse files
gh-149831: Fix ctypes DLL library name on Cygwin (#149832)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent a318a9d commit 50aff5f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/ctypes/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,11 @@ def LoadLibrary(self, name):
549549

550550
if _os.name == "nt":
551551
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
552-
elif _sys.platform in ["android", "cygwin"]:
552+
elif _sys.platform == "android":
553553
# These are Unix-like platforms which use a dynamically-linked libpython.
554554
pythonapi = PyDLL(_sysconfig.get_config_var("LDLIBRARY"))
555+
elif _sys.platform == "cygwin":
556+
pythonapi = PyDLL(_sysconfig.get_config_var("DLLLIBRARY"))
555557
else:
556558
pythonapi = PyDLL(None)
557559

0 commit comments

Comments
 (0)