관리-도구
편집 파일: fix_features.cpython-37.opt-1.pyc
B �A�[s � @ sJ d Z ddlmZmZ ddlmZ ddddd d ddgZG d d� dej�ZdS )z� Warn about features that are not present in Python 2.5, giving a message that points to the earliest version of Python 2.x (or 3.x, if none) that supports it � )�Feature�Features� )� fixer_base)� memoryviewz4power < 'memoryview' trailer < '(' any* ')' > any* >z2.7)Znumbersz�import_from< 'from' 'numbers' 'import' any* > | import_name< 'import' ('numbers' dotted_as_names< any* 'numbers' any* >) >z2.6)�abczyimport_name< 'import' ('abc' dotted_as_names< any* 'abc' any* >) > | import_from< 'from' 'abc' 'import' any* >z2.6)�iozvimport_name< 'import' ('io' dotted_as_names< any* 'io' any* >) > | import_from< 'from' 'io' 'import' any* >z2.6)�binz+power< 'bin' trailer< '(' any* ')' > any* >z2.6)Z formattingz<power< any trailer< '.' 'format' > trailer< '(' any* ')' > >z2.6)�nonlocalzglobal_stmt< 'nonlocal' any* >z3.0)�with_tracebackztrailer< '.' 'with_traceback' >z3.0c sF e Zd ZdZe� Zedd� eD ��Zej Z � fdd�Z dd� Z� ZS )�FixFeatures� c C s g | ]\}}}t |||��qS � )r )�.0�name�pattern�versionr r �Q/opt/alt/python37/lib/python3.7/site-packages/libpasteurize/fixes/fix_features.py� <listcomp>; s zFixFeatures.<listcomp>c s4 t t| ��|�}y |d= W n tk r. Y nX |S )N�node)�superr �match� Exception)�selfr Zto_ret)� __class__r r r @ s zFixFeatures.matchc C s^ xX|D ]P}|| j krqq| j| }|jdkr4| j}n| j}|||�� d� | j �|� qW d S )N�3)�reason)�features_warned�featuresr Zcannot_convertZwarningZmessage_text�add)r r ZresultsZfeature_nameZcurr_featureZfailr r r � transformK s zFixFeatures.transform) �__name__� __module__�__qualname__Z run_order�setr r �FEATURESr ZPATTERNr r � __classcell__r r )r r r 3 s r N) �__doc__Zfeature_baser r Zlib2to3r r% ZBaseFixr r r r r �<module> s