summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-10-18 22:05:25 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-10-18 22:05:25 (GMT)
commitdd7eb146a8c5509a473b22f15eb91ada790fd0ce (patch)
tree070f2a8abd7c276d2c7fe5dbd18d656fcdbe9d69
parent0f0c06a5c2ebe8c24414b50bf7a6a23142694521 (diff)
downloadcpython-dd7eb146a8c5509a473b22f15eb91ada790fd0ce.zip
cpython-dd7eb146a8c5509a473b22f15eb91ada790fd0ce.tar.gz
cpython-dd7eb146a8c5509a473b22f15eb91ada790fd0ce.tar.bz2
Patch #792869: Clarify error message for parameters declared global,
rename LOCAL_GLOBAL to PARAM_GLOBAL.
-rw-r--r--Python/compile.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 02c7873..4fb47ae 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -60,7 +60,7 @@ int Py_OptimizeFlag = 0;
#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 @@ symtable_load_symbols(struct compiling *c)
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 @@ symtable_global(struct symtable *st, node *n)
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;