Commit 81bd573a authored by Mark Florisson's avatar Mark Florisson

py23 compatibility

parent 9467c481
...@@ -214,8 +214,8 @@ def create_py_pipeline(context, options, result): ...@@ -214,8 +214,8 @@ def create_py_pipeline(context, options, result):
return create_pyx_pipeline(context, options, result, py=True) return create_pyx_pipeline(context, options, result, py=True)
def create_pyx_as_pxd_pipeline(context, result): def create_pyx_as_pxd_pipeline(context, result):
from ParseTreeTransforms import (AlignFunctionDefinitions, from ParseTreeTransforms import AlignFunctionDefinitions, \
MarkClosureVisitor, WithTransform, AnalyseDeclarationsTransform) MarkClosureVisitor, WithTransform, AnalyseDeclarationsTransform
from Optimize import ConstantFolding, FlattenInListTransform from Optimize import ConstantFolding, FlattenInListTransform
from Nodes import StatListNode from Nodes import StatListNode
pipeline = [] pipeline = []
......
...@@ -285,6 +285,9 @@ class Scope(object): ...@@ -285,6 +285,9 @@ class Scope(object):
entries = [(name, entry) entries = [(name, entry)
for name, entry in other.entries.iteritems() for name, entry in other.entries.iteritems()
if entry.used or merge_unused] if entry.used or merge_unused]
# !@#$ py23
entries = dict(entries)
self.entries.update(entries) self.entries.update(entries)
for attr in ('const_entries', for attr in ('const_entries',
...@@ -950,7 +953,12 @@ class ModuleScope(Scope): ...@@ -950,7 +953,12 @@ class ModuleScope(Scope):
entry = self.lookup_here(name) entry = self.lookup_here(name)
if entry is not None: if entry is not None:
return entry return entry
language_level = self.context.language_level if self.context is not None else 3
if self.context is not None:
language_level = self.context.language_level
else:
language_level = 3
return self.outer_scope.lookup(name, language_level=language_level) return self.outer_scope.lookup(name, language_level=language_level)
def declare_builtin(self, name, pos): def declare_builtin(self, name, pos):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment