summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-07-20 22:37:19 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-07-20 22:37:19 (GMT)
commit013783c529cfc459d05d261f5053ad7bf7d88c29 (patch)
tree14e1b8205a78e85d9ba688f315cf89f82aad3a20 /Python/ceval.c
parent533a167a713be4a30b92583636cd2323f4c8c3aa (diff)
downloadcpython-013783c529cfc459d05d261f5053ad7bf7d88c29.zip
cpython-013783c529cfc459d05d261f5053ad7bf7d88c29.tar.gz
cpython-013783c529cfc459d05d261f5053ad7bf7d88c29.tar.bz2
move test_trace.py so as not to conflict with future tests for the trace module
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 2d4b16a..368ad69 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2052,6 +2052,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
break;
TARGET(LOAD_NAME)
+ TARGET(LOAD_NAME_LOCAL_ONLY)
w = GETITEM(names, oparg);
if ((v = f->f_locals) == NULL) {
PyErr_Format(PyExc_SystemError,
@@ -2073,15 +2074,14 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
}
}
if (x == NULL) {
- x = PyDict_GetItem(f->f_globals, w);
+ if (opcode != LOAD_NAME_LOCAL_ONLY) {
+ x = PyDict_GetItem(f->f_globals, w);
+ if (x == NULL)
+ x = PyDict_GetItem(f->f_builtins, w);
+ }
if (x == NULL) {
- x = PyDict_GetItem(f->f_builtins, w);
- if (x == NULL) {
- format_exc_check_arg(
- PyExc_NameError,
- NAME_ERROR_MSG, w);
- break;
- }
+ format_exc_check_arg(PyExc_NameError, NAME_ERROR_MSG, w);
+ break;
}
Py_INCREF(x);
}