Skip to content

Commit 26f786f

Browse files
committed
Also open the potentially duplicated libpython so on posix
1 parent a6d8093 commit 26f786f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,10 @@ def LoadLibrary(self, name):
472472
elif _sys.platform == "cygwin":
473473
pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
474474
else:
475-
pythonapi = PyDLL(None)
475+
# GraalPy change: we _dlopen right here, libpython-native it may be different per context
476+
pythonapi = PyDLL(None, None, _dlopen(_sys._dllhandle_name, 0))
477+
# pythonapi = PyDLL(None)
478+
# End GraalPy change
476479

477480

478481
if _os.name == "nt":

0 commit comments

Comments
 (0)