# HG changeset patch # User Ram Rachum # Date 1360353876 -7200 # Node ID 8e9346e7ae87f17ac46b521ed1d99cd79f8a7710 # Parent 5c4b005811981afa49c079c09c7aaa872733891a no annoying "global name" exception diff --git a/Python/ceval.c b/Python/ceval.c --- a/Python/ceval.c +++ b/Python/ceval.c @@ -142,8 +142,6 @@ #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 @@ 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 @@ 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 @@ if (PyErr_ExceptionMatches(PyExc_KeyError)) format_exc_check_arg( PyExc_NameError, - GLOBAL_NAME_ERROR_MSG, name); + NAME_ERROR_MSG, name); goto error; } }