fix_fullargspec.py 438 B

12345678910111213141516
  1. u"""
  2. Fixer for getfullargspec -> getargspec
  3. """
  4. from lib2to3 import fixer_base
  5. from lib2to3.fixer_util import Name
  6. warn_msg = u"some of the values returned by getfullargspec are not valid in Python 2 and have no equivalent."
  7. class FixFullargspec(fixer_base.BaseFix):
  8. PATTERN = u"'getfullargspec'"
  9. def transform(self, node, results):
  10. self.warning(node, warn_msg)
  11. return Name(u"getargspec", prefix=node.prefix)