]> granicus.if.org Git - python/commitdiff
Patch #792869: Clarify error message for parameters declared global,
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Oct 2003 22:05:25 +0000 (22:05 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Oct 2003 22:05:25 +0000 (22:05 +0000)
rename LOCAL_GLOBAL to PARAM_GLOBAL.

Python/compile.c

index 02c7873a0741b345fc388d56349e5cf9b1113339..4fb47ae84acbabda918859d264b7c282d9cb294d 100644 (file)
@@ -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;