fix_basestring.py 320 B

1234567891011121314
  1. """Fixer for basestring -> str."""
  2. # Author: Christian Heimes
  3. # Local imports
  4. from .. import fixer_base
  5. from ..fixer_util import Name
  6. class FixBasestring(fixer_base.BaseFix):
  7. BM_compatible = True
  8. PATTERN = "'basestring'"
  9. def transform(self, node, results):
  10. return Name("str", prefix=node.prefix)