don't identify the toplevel namespace by name #9997

This commit is contained in:
Benjamin Peterson 2010-10-16 03:45:45 +00:00
parent 294a9fcba6
commit 230b20684f
3 changed files with 12 additions and 1 deletions

View file

@ -924,7 +924,7 @@ symtable_enter_block(struct symtable *st, identifier name, _Py_block_ty block,
st->st_cur = ste_new(st, name, block, ast, lineno, col_offset);
if (st->st_cur == NULL)
return 0;
if (name == GET_IDENTIFIER(top))
if (block == ModuleBlock)
st->st_global = st->st_cur->ste_symbols;
if (prev) {
if (PyList_Append(prev->ste_children,