fix_long.py 476 B

12345678910111213141516171819
  1. # Copyright 2006 Google, Inc. All Rights Reserved.
  2. # Licensed to PSF under a Contributor Agreement.
  3. """Fixer that turns 'long' into 'int' everywhere.
  4. """
  5. # Local imports
  6. from lib2to3 import fixer_base
  7. from lib2to3.fixer_util import is_probably_builtin
  8. class FixLong(fixer_base.BaseFix):
  9. BM_compatible = True
  10. PATTERN = "'long'"
  11. def transform(self, node, results):
  12. if is_probably_builtin(node):
  13. node.value = "int"
  14. node.changed()