Move is_scope and get_parent_scope out of the parser.

This commit is contained in:
Dave Halter
2017-05-07 14:58:53 +02:00
parent 0882849e65
commit 536e62e67d
10 changed files with 44 additions and 42 deletions
+1 -1
View File
@@ -276,7 +276,7 @@ class FunctionContext(use_metaclass(CachedMetaClass, context.TreeContext)):
def py__class__(self):
# This differentiation is only necessary for Python2. Python3 does not
# use a different method class.
if isinstance(self.tree_node.get_parent_scope(), tree.Class):
if isinstance(parser_utils.get_parent_scope(self.tree_node), tree.Class):
name = 'METHOD_CLASS'
else:
name = 'FUNCTION_CLASS'