From: Guido van Rossum Date: Sat, 24 Aug 1996 07:29:04 +0000 (+0000) Subject: Oops need to mangle global statement separately X-Git-Tag: v1.4b3~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe2236f3c873254558bba274b1b3a6a21416339a;p=thirdparty%2FPython%2Fcpython.git Oops need to mangle global statement separately --- diff --git a/Python/compile.c b/Python/compile.c index 0ecf69c721b8..ad58606e0123 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1779,6 +1779,13 @@ com_global_stmt(c, n) /* 'global' NAME (',' NAME)* */ for (i = 1; i < NCH(n); i += 2) { char *s = STR(CHILD(n, i)); +#ifdef PRIVATE_NAME_MANGLING + char buffer[256]; + if (s != NULL && s[0] == '_' && s[1] == '_' && + c->c_private != NULL && + com_mangle(c, s, buffer, (int)sizeof(buffer))) + s = buffer; +#endif if (dictlookup(c->c_locals, s) != NULL) { err_setstr(SyntaxError, "name is local and global"); c->c_errors++;