summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-03-03 13:12:44 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-03-03 13:12:44 (GMT)
commit04a29554c1fe0a06cdc657229bb4332eb017e3e9 (patch)
tree8b239108ffbb68db08170358790b14df39dae92f /Python/ceval.c
parentee71f4a8a435eadef176b9a651d5245d7be03e51 (diff)
downloadcpython-04a29554c1fe0a06cdc657229bb4332eb017e3e9.zip
cpython-04a29554c1fe0a06cdc657229bb4332eb017e3e9.tar.gz
cpython-04a29554c1fe0a06cdc657229bb4332eb017e3e9.tar.bz2
#17032: The "global" in the "NameError: global name 'x' is not defined" error message has been removed. Patch by Ram Rachum.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index d8787d3..6132e16 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -142,8 +142,6 @@ static PyObject * special_lookup(PyObject *, _Py_Identifier *);
#define NAME_ERROR_MSG \
"name '%.200s' is not defined"
-#define GLOBAL_NAME_ERROR_MSG \
- "global name '%.200s' is not defined"
#define UNBOUNDLOCAL_ERROR_MSG \
"local variable '%.200s' referenced before assignment"
#define UNBOUNDFREE_ERROR_MSG \
@@ -2140,7 +2138,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
err = PyDict_DelItem(f->f_globals, name);
if (err != 0) {
format_exc_check_arg(
- PyExc_NameError, GLOBAL_NAME_ERROR_MSG, name);
+ PyExc_NameError, NAME_ERROR_MSG, name);
goto error;
}
DISPATCH();
@@ -2208,7 +2206,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
if (v == NULL) {
if (!PyErr_Occurred())
format_exc_check_arg(PyExc_NameError,
- GLOBAL_NAME_ERROR_MSG, name);
+ NAME_ERROR_MSG, name);
goto error;
}
Py_INCREF(v);
@@ -2222,7 +2220,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
if (PyErr_ExceptionMatches(PyExc_KeyError))
format_exc_check_arg(
PyExc_NameError,
- GLOBAL_NAME_ERROR_MSG, name);
+ NAME_ERROR_MSG, name);
goto error;
}
}