PageRenderTime 50ms CodeModel.GetById 46ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Lib/lib2to3/fixes/fix_getcwdu.py

http://unladen-swallow.googlecode.com/
Python | 18 lines | 10 code | 3 blank | 5 comment | 0 complexity | 1bf89e0a81cc997173d5d63078f8ea5a MD5 | raw file
 1"""
 2Fixer that changes os.getcwdu() to os.getcwd().
 3"""
 4# Author: Victor Stinner
 5
 6# Local imports
 7from .. import fixer_base
 8from ..fixer_util import Name
 9
10class FixGetcwdu(fixer_base.BaseFix):
11
12    PATTERN = """
13              power< 'os' trailer< dot='.' name='getcwdu' > any* >
14              """
15
16    def transform(self, node, results):
17        name = results["name"]
18        name.replace(Name("getcwd", prefix=name.get_prefix()))