just return toplevel symbol table rather than all blocks (closes #19393)
diff --git a/Lib/symtable.py b/Lib/symtable.py
index ca73f58..0ba9d1a 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -10,10 +10,7 @@
__all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"]
def symtable(code, filename, compile_type):
- raw = _symtable.symtable(code, filename, compile_type)
- for top in raw.itervalues():
- if top.name == 'top':
- break
+ top = _symtable.symtable(code, filename, compile_type)
return _newSymbolTable(top, filename)
class SymbolTableFactory: