mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-14 14:49:21 +01:00
Add 2to3/fix_reload.py.
This commit is contained in:
parent
32a7da6f51
commit
d4f5c03b3f
27
2to3/fix_reload.py
Normal file
27
2to3/fix_reload.py
Normal file
@ -0,0 +1,27 @@
|
||||
# Based on fix_intern.py. Original copyright:
|
||||
# Copyright 2006 Georg Brandl.
|
||||
# Licensed to PSF under a Contributor Agreement.
|
||||
|
||||
"""Fixer for intern().
|
||||
|
||||
intern(s) -> sys.intern(s)"""
|
||||
|
||||
# Local imports
|
||||
from lib2to3 import pytree
|
||||
from lib2to3 import fixer_base
|
||||
from lib2to3.fixer_util import Name, Attr, touch_import
|
||||
|
||||
|
||||
class FixReload(fixer_base.BaseFix):
|
||||
BM_compatible = True
|
||||
order = "pre"
|
||||
|
||||
PATTERN = """
|
||||
power< 'reload'
|
||||
after=any*
|
||||
>
|
||||
"""
|
||||
|
||||
def transform(self, node, results):
|
||||
touch_import(u'imp', u'reload', node)
|
||||
return node
|
@ -2,11 +2,12 @@
|
||||
import sys
|
||||
from lib2to3.main import main
|
||||
|
||||
import fix_def_iteritems, fix_def_itervalues, fix_def_iterkeys
|
||||
import fix_def_iteritems, fix_def_itervalues, fix_def_iterkeys, fix_reload
|
||||
|
||||
# Hacks
|
||||
sys.modules['lib2to3.fixes.fix_def_iteritems'] = fix_def_iteritems
|
||||
sys.modules['lib2to3.fixes.fix_def_itervalues'] = fix_def_itervalues
|
||||
sys.modules['lib2to3.fixes.fix_def_iterkeys'] = fix_def_iterkeys
|
||||
sys.modules['lib2to3.fixes.fix_reload'] = fix_reload
|
||||
|
||||
sys.exit(main("lib2to3.fixes"))
|
||||
|
@ -1 +1 @@
|
||||
python 2to3/run.py src/ plugins/ test/ scripts/* setup.py -wn -f all -f def_iteritems -f def_itervalues -f def_iterkeys "$@"
|
||||
python 2to3/run.py src/ plugins/ test/ scripts/* setup.py -wn -f all -f def_iteritems -f def_itervalues -f def_iterkeys -f reload "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user