Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 4130:7b84dae97ee8 legacy-trunk
Oops need to mangle global statement separately
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Sat, 24 Aug 1996 07:29:04 +0000 |
| parents | eedaa59341b9 |
| children | 6b589334e0e9 |
line wrap: on
line diff
--- a/Python/compile.c Sat Aug 24 06:21:31 1996 +0000 +++ b/Python/compile.c Sat Aug 24 07:29:04 1996 +0000 @@ -1779,6 +1779,13 @@ /* '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++;
