PATH:
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
libfuturize
/
fixes
# coding: utf-8 """ Fixer for the execfile() function on Py2, which was removed in Py3. The Lib/lib2to3/fixes/fix_execfile.py module has some problems: see python-future issue #37. This fixer merely imports execfile() from past.builtins and leaves the code alone. Adds this import line:: from past.builtins import execfile for the function execfile() that was removed from Py3. """ from __future__ import unicode_literals from lib2to3 import fixer_base from libfuturize.fixer_util import touch_import_top expression = "name='execfile'" class FixExecfile(fixer_base.BaseFix): BM_compatible = True run_order = 9 PATTERN = """ power< ({0}) trailer< '(' args=[any] ')' > rest=any* > """.format(expression) def transform(self, node, results): name = results["name"] touch_import_top(u'past.builtins', name.value, node)
[+]
__pycache__
[-] fix_raise.py
[edit]
[-] fix_next_call.py
[edit]
[-] __init__.py
[edit]
[-] fix_print.py
[edit]
[-] fix_metaclass.py
[edit]
[-] fix_cmp.py
[edit]
[+]
..
[-] fix_future_builtins.py
[edit]
[-] fix_unicode_literals_import.py
[edit]
[-] fix_remove_old__future__imports.py
[edit]
[-] fix_future_standard_library_urllib.py
[edit]
[-] fix_bytes.py
[edit]
[-] fix_unicode_keep_u.py
[edit]
[-] fix_future_standard_library.py
[edit]
[-] fix_order___future__imports.py
[edit]
[-] fix_oldstr_wrap.py
[edit]
[-] fix_UserDict.py
[edit]
[-] fix_xrange_with_import.py
[edit]
[-] fix_division.py
[edit]
[-] fix_print_with_import.py
[edit]
[-] fix_basestring.py
[edit]
[-] fix_absolute_import.py
[edit]
[-] fix_object.py
[edit]
[-] fix_division_safe.py
[edit]
[-] fix_add__future__imports_except_unicode_literals.py
[edit]
[-] fix_execfile.py
[edit]