mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
just return toplevel symbol table rather than all blocks (closes #19393)
This commit is contained in:
parent
050fcd51cc
commit
89d8cd943b
3 changed files with 5 additions and 5 deletions
|
@ -10,10 +10,7 @@ import weakref
|
|||
__all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"]
|
||||
|
||||
def symtable(code, filename, compile_type):
|
||||
raw = _symtable.symtable(code, filename, compile_type)
|
||||
for top in raw.values():
|
||||
if top.name == 'top':
|
||||
break
|
||||
top = _symtable.symtable(code, filename, compile_type)
|
||||
return _newSymbolTable(top, filename)
|
||||
|
||||
class SymbolTableFactory:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue