Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 2e789a1f1d84b343a996e8654590703b5fbdd441 authored by Larry Hastings on 12 September 2015, 16:36:44 UTC
Final touch-ups for the What's New In Python 3.5 document.
Tip revision: 2e789a1
fix_getcwdu.py
"""
Fixer that changes os.getcwdu() to os.getcwd().
"""
# Author: Victor Stinner

# Local imports
from .. import fixer_base
from ..fixer_util import Name

class FixGetcwdu(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
              power< 'os' trailer< dot='.' name='getcwdu' > any* >
              """

    def transform(self, node, results):
        name = results["name"]
        name.replace(Name("getcwd", prefix=name.prefix))
back to top