Skip to content

Commit 2a0e173

Browse files
committed
Fix error case in 'PyDict_GetItem'.
1 parent 6372eca commit 2a0e173

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
@@ -129,7 +129,7 @@ def PyDict_Copy(dictObj):
129129
def PyDict_GetItem(dictObj, key):
130130
if not isinstance(dictObj, dict):
131131
raise TypeError('expected dict, {!s} found'.format(type(dictObj)))
132-
return dictObj[key]
132+
return dictObj.get(key, error_handler)
133133

134134

135135
@may_raise(-1)

0 commit comments

Comments
 (0)