Skip to content

Commit 7834a6c

Browse files
committed
Fix: PyState_FindModule must not raise KeyError
1 parent 83f4c3f commit 7834a6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graalpython/lib-graalpython/python_cext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ def PyMapping_Values(obj):
13711371

13721372
@may_raise
13731373
def PyState_FindModule(module_name):
1374-
return sys.modules[module_name]
1374+
return sys.modules.get(module_name, native_null)
13751375

13761376

13771377
@may_raise

0 commit comments

Comments
 (0)