diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-11-05 12:56:58 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-11-05 12:56:58 (GMT) |
commit | e20310fa19188f764b84fbdc40d32d6933f98af9 (patch) | |
tree | c73dc9663e3eae48af1d2933c60ae3b8d9de9641 /Python | |
parent | ef072961e1773ad6b066ae22fc507c28f91c6a3a (diff) | |
download | cpython-e20310fa19188f764b84fbdc40d32d6933f98af9.zip cpython-e20310fa19188f764b84fbdc40d32d6933f98af9.tar.gz cpython-e20310fa19188f764b84fbdc40d32d6933f98af9.tar.bz2 |
Issue #25556: Add assertions to PyObject_GetItem() to ensure that an exception
is raised when it returns NULL.
Simplify also ceval.c: rely on the fact that PyObject_GetItem() raised an
exception when it returns NULL.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 67ea388..7f9ef6f 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2307,7 +2307,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) } else { v = PyObject_GetItem(locals, name); - if (v == NULL && _PyErr_OCCURRED()) { + if (v == NULL) { if (!PyErr_ExceptionMatches(PyExc_KeyError)) goto error; PyErr_Clear(); @@ -2426,7 +2426,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) } else { value = PyObject_GetItem(locals, name); - if (value == NULL && PyErr_Occurred()) { + if (value == NULL) { if (!PyErr_ExceptionMatches(PyExc_KeyError)) goto error; PyErr_Clear(); |