Skip to content

Commit 28512bc

Browse files
committed
Load C API when using ctypes.dlopen
1 parent 005eb4d commit 28512bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ctypes/CtypesModuleBuiltins.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,9 @@ static Object py_dl_open(VirtualFrame frame, PythonModule self, TruffleString na
746746
return factory.createNativeVoidPtr(((CtypesModuleBuiltins) self.getBuiltins()).rtldDefault);
747747
}
748748

749+
// The loaded library can link against libpython, so we have to make sure it is loaded
750+
CApiContext.ensureCapiWasLoaded();
751+
749752
int mode = m != Integer.MIN_VALUE ? m : RTLD_LOCAL.getValueIfDefined();
750753
mode |= RTLD_NOW.getValueIfDefined();
751754
PythonContext context = PythonContext.get(inliningTarget);

0 commit comments

Comments
 (0)