fix_standarderror.py 449 B

123456789101112131415161718
  1. # Copyright 2007 Google, Inc. All Rights Reserved.
  2. # Licensed to PSF under a Contributor Agreement.
  3. """Fixer for StandardError -> Exception."""
  4. # Local imports
  5. from .. import fixer_base
  6. from ..fixer_util import Name
  7. class FixStandarderror(fixer_base.BaseFix):
  8. BM_compatible = True
  9. PATTERN = """
  10. 'StandardError'
  11. """
  12. def transform(self, node, results):
  13. return Name("Exception", prefix=node.prefix)