Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fbfe093

Browse files
committed
Check for exceptions set by PyDict_GetItem().
1 parent 811c4e0 commit fbfe093

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Python/compile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,8 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
959959

960960
v = PyDict_GetItem(dict, t);
961961
if (!v) {
962+
if (PyErr_Occurred())
963+
return -1;
962964
arg = PyDict_Size(dict);
963965
v = PyInt_FromLong(arg);
964966
if (!v) {

0 commit comments

Comments
 (0)