Home | History | Annotate | Download | only in fixes
      1 """
      2 Fixer that changes os.getcwdu() to os.getcwd().
      3 """
      4 # Author: Victor Stinner
      5 
      6 # Local imports
      7 from .. import fixer_base
      8 from ..fixer_util import Name
      9 
     10 class FixGetcwdu(fixer_base.BaseFix):
     11     BM_compatible = True
     12 
     13     PATTERN = """
     14               power< 'os' trailer< dot='.' name='getcwdu' > any* >
     15               """
     16 
     17     def transform(self, node, results):
     18         name = results["name"]
     19         name.replace(Name(u"getcwd", prefix=name.prefix))
     20