From: Jeremy Hylton Date: Wed, 23 Aug 2006 18:13:39 +0000 (+0000) Subject: Check for exceptions set by PyDict_GetItem(). X-Git-Tag: v3.0a1~1357 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fbfe0936078e16829f36a6e61b511c123fd17b17;p=python Check for exceptions set by PyDict_GetItem(). --- diff --git a/Python/compile.c b/Python/compile.c index 678a4deee9..464c953b22 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -959,6 +959,8 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o) v = PyDict_GetItem(dict, t); if (!v) { + if (PyErr_Occurred()) + return -1; arg = PyDict_Size(dict); v = PyInt_FromLong(arg); if (!v) {