/Lib/lib2to3/fixes/fix_standarderror.py

http://unladen-swallow.googlecode.com/ · Python · 18 lines · 8 code · 6 blank · 4 comment · 0 complexity · f76efc435650b1eba8bf73dbdfdeef3e MD5 · raw file

  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. PATTERN = """
  9. 'StandardError'
  10. """
  11. def transform(self, node, results):
  12. return Name("Exception", prefix=node.get_prefix())