Commit cb6278ab authored by Petr Viktorin's avatar Petr Viktorin

2to3: Apply 'funcattrs' fixer (conditionally)

parent 20879e4c
lib2to3.fixes.fix_basestring
lib2to3.fixes.fix_dict
lib2to3.fixes.fix_funcattrs
lib2to3.fixes.fix_future
lib2to3.fixes.fix_has_key
lib2to3.fixes.fix_import
......
......@@ -22,6 +22,8 @@ from ..Compiler import Pipeline, Nodes
from ..Utils import get_cython_cache_dir
import cython as cython_module
IS_PY3 = sys.version_info >= (3, 0)
# A utility function to convert user-supplied ASCII strings to unicode.
if sys.version_info[0] < 3:
def to_unicode(s):
......@@ -309,4 +311,7 @@ class RuntimeCompiledFunction(object):
def __call__(self, *args, **kwds):
all = getcallargs(self._f, *args, **kwds)
if IS_PY3:
return cython_inline(self._body, locals=self._f.__globals__, globals=self._f.__globals__, **all)
else:
return cython_inline(self._body, locals=self._f.func_globals, globals=self._f.func_globals, **all)
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