diff options
author | Guido van Rossum <guido@python.org> | 1996-08-24 07:29:04 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-08-24 07:29:04 (GMT) |
commit | fe2236f3c873254558bba274b1b3a6a21416339a (patch) | |
tree | 1efa0833d78e5a5741280615700dafcdc35c9a5f /Python/compile.c | |
parent | 8ff077b0949791c6b699cb179749d929a9fdc98a (diff) | |
download | cpython-fe2236f3c873254558bba274b1b3a6a21416339a.zip cpython-fe2236f3c873254558bba274b1b3a6a21416339a.tar.gz cpython-fe2236f3c873254558bba274b1b3a6a21416339a.tar.bz2 |
Oops need to mangle global statement separately
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c index 0ecf69c..ad58606 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++; |