3
+��hi � @ s2 d Z ddlmZ ddlmZ G dd� dej�ZdS )zm
Fixer for os.getcwd() -> os.getcwdu().
Also warns about "from os import getcwd", suggesting the above form.
� )�
fixer_base)�Namec @ s e Zd ZdZdd� ZdS )� FixGetcwdz�
power< 'os' trailer< dot='.' name='getcwd' > any* >
|
import_from< 'from' 'os' 'import' bad='getcwd' >
c C sJ d|kr&|d }|j td|jd�� n d|kr>| j|d� d S td��d S )N�nameZgetcwdu)�prefix�badz#import os, use os.getcwd() instead.z,For some reason, the pattern matcher failed.)�replacer r Zcannot_convert�
ValueError)�self�node�resultsr � r
�E/root/tmp/pip-build-yeh9mt8d/future/libpasteurize/fixes/fix_getcwd.py� transform s zFixGetcwd.transformN)�__name__�
__module__�__qualname__ZPATTERNr r
r
r
r r s r N)�__doc__Zlib2to3r Zlib2to3.fixer_utilr ZBaseFixr r
r
r
r �<module> s |