Skip to content

Commit 049b02e

Browse files
committed
Set sys.dllhandle when loading ctypes
1 parent d9b23b7 commit 049b02e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graalpython/lib-python/3/ctypes/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,9 @@ def LoadLibrary(self, name):
465465
pydll = LibraryLoader(PyDLL)
466466

467467
if _os.name == "nt":
468+
# GraalPy change: we set the dllhandle here
469+
_sys.dllhandle = _dlopen("python-native.dll", 0)
470+
# End GraalPy change
468471
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
469472
elif _sys.platform == "cygwin":
470473
pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])

0 commit comments

Comments
 (0)