3
‡Œðii  ã               @   s2   d Z ddlmZ ddlmZ G dd„ dejƒZdS )zm
Fixer for os.getcwd() -> os.getcwdu().
Also warns about "from os import getcwd", suggesting the above form.
é    )Ú
fixer_base)ÚNamec               @   s   e Zd ZdZdd„ ZdS )Ú	FixGetcwdz 
              power< 'os' trailer< dot='.' name='getcwd' > any* >
              |
              import_from< 'from' 'os' 'import' bad='getcwd' >
              c             C   sJ   d|kr&|d }|j td|jd�ƒ n d|kr>| j|dƒ d S tdƒ‚d S )NÚnameZgetcwdu)ÚprefixÚbadz#import os, use os.getcwd() instead.z,For some reason, the pattern matcher failed.)Úreplacer   r   Zcannot_convertÚ
ValueError)ÚselfÚnodeÚresultsr   © r   ú@/tmp/pip-build-6m2fasei/future/libpasteurize/fixes/fix_getcwd.pyÚ	transform   s    zFixGetcwd.transformN)Ú__name__Ú
__module__Ú__qualname__ZPATTERNr   r   r   r   r   r   	   s   r   N)Ú__doc__Zlib2to3r   Zlib2to3.fixer_utilr   ZBaseFixr   r   r   r   r   Ú<module>   s   