summaryrefslogtreecommitdiffstats
path: root/Lib/symtable.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/symtable.py')
-rw-r--r--Lib/symtable.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/symtable.py b/Lib/symtable.py
index 7548a7f..39c1a80 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -2,9 +2,8 @@
import _symtable
from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM,
- DEF_FREE_GLOBAL, DEF_FREE_CLASS, DEF_IMPORT, DEF_BOUND,
- OPT_IMPORT_STAR, SCOPE_OFF, SCOPE_MASK, FREE,
- GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)
+ DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, SCOPE_OFF, SCOPE_MASK, FREE,
+ LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)
import weakref
@@ -138,7 +137,9 @@ class Function(SymbolTable):
def get_locals(self):
if self.__locals is None:
- self.__locals = self.__idents_matching(lambda x:x & DEF_BOUND)
+ locs = (LOCAL, CELL)
+ test = lambda x: ((x >> SCOPE_OFF) & SCOPE_MASK) in locs
+ self.__locals = self.__idents_matching(test)
return self.__locals
def get_globals(self):