Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 30713:9c7e0227c835 legacy-trunk
Patch #792869: Clarify error message for parameters declared global,
rename LOCAL_GLOBAL to PARAM_GLOBAL.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Sat, 18 Oct 2003 22:05:25 +0000 |
| parents | 3b59fa5d25b1 |
| children | 9c846c3df6f3 |
line wrap: on
line diff
--- a/Python/compile.c Sat Oct 18 20:54:44 2003 +0000 +++ b/Python/compile.c Sat Oct 18 22:05:25 2003 +0000 @@ -60,7 +60,7 @@ #define GLOBAL_AFTER_USE \ "name '%.400s' is used prior to global declaration" -#define LOCAL_GLOBAL \ +#define PARAM_GLOBAL \ "name '%.400s' is a function parameter and declared global" #define LATE_FUTURE \ @@ -4843,7 +4843,7 @@ c->c_argcount--; else if (flags & DEF_GLOBAL) { if (flags & DEF_PARAM) { - PyErr_Format(PyExc_SyntaxError, LOCAL_GLOBAL, + PyErr_Format(PyExc_SyntaxError, PARAM_GLOBAL, PyString_AS_STRING(name)); symtable_error(st, 0); goto fail; @@ -5592,8 +5592,7 @@ if (flags && flags != DEF_GLOBAL) { char buf[500]; if (flags & DEF_PARAM) { - PyErr_Format(PyExc_SyntaxError, - "name '%.400s' is local and global", + PyErr_Format(PyExc_SyntaxError, PARAM_GLOBAL, name); symtable_error(st, 0); return;
