mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 21:29:24 +01:00
28 lines
576 B
Python
28 lines
576 B
Python
|
# 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
|