projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d11a94
)
Issue #25556: Fix LOAD_GLOBAL bytecode when globals type is not dict and the
author
Victor Stinner
<victor.stinner@gmail.com>
Thu, 5 Nov 2015 12:55:20 +0000
(13:55 +0100)
committer
Victor Stinner
<victor.stinner@gmail.com>
Thu, 5 Nov 2015 12:55:20 +0000
(13:55 +0100)
requested name doesn't exist in globals: clear the KeyError exception before
calling PyObject_GetItem(). Fail also if the raised exception is not a
KeyError.
Python/ceval.c
patch
|
blob
|
history
diff --git
a/Python/ceval.c
b/Python/ceval.c
index f9e8ef885995ba0b81d906c61232a44fa61d42b4..beabfebc1c7e205fcaab186330bf5d7025b4410e 100644
(file)
--- a/
Python/ceval.c
+++ b/
Python/ceval.c
@@
-2363,6
+2363,10
@@
PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
/* Slow-path if globals or builtins is not a dict */
v = PyObject_GetItem(f->f_globals, name);
if (v == NULL) {
+ if (!PyErr_ExceptionMatches(PyExc_KeyError))
+ goto error;
+ PyErr_Clear();
+
v = PyObject_GetItem(f->f_builtins, name);
if (v == NULL) {
if (PyErr_ExceptionMatches(PyExc_KeyError))