PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Lib/lib2to3/fixes/fix_standarderror.py

http://unladen-swallow.googlecode.com/
Python | 18 lines | 9 code | 5 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
 4"""Fixer for StandardError -> Exception."""
 5
 6# Local imports
 7from .. import fixer_base
 8from ..fixer_util import Name
 9
10
11class FixStandarderror(fixer_base.BaseFix):
12
13    PATTERN = """
14              'StandardError'
15              """
16
17    def transform(self, node, results):
18        return Name("Exception", prefix=node.get_prefix())