a 97as @s>dZddlmZmZddlmZgdZGdddejZdS) 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 )FeatureFeatures) fixer_base)) memoryviewz4power < 'memoryview' trailer < '(' any* ')' > any* >z2.7)Znumberszimport_from< 'from' 'numbers' 'import' any* > | import_name< 'import' ('numbers' dotted_as_names< any* 'numbers' any* >) >2.6)abczyimport_name< 'import' ('abc' dotted_as_names< any* 'abc' any* >) > | import_from< 'from' 'abc' 'import' any* >r)iozvimport_name< 'import' ('io' dotted_as_names< any* 'io' any* >) > | import_from< 'from' 'io' 'import' any* >r)binz+power< 'bin' trailer< '(' any* ')' > any* >r)Z formattingz trailer< '(' any* ')' > >r)nonlocalzglobal_stmt< 'nonlocal' any* >3.0)with_tracebackztrailer< '.' 'with_traceback' >r csFeZdZdZeZeddeDZej Z fddZ ddZ Z S) FixFeatures cCsg|]\}}}t|||qS)r).0namepatternversionrr{/private/var/folders/s6/9n5zrl012gv99k63s4q6ccsd4s6mqz/T/pip-target-f5cq3f2q/lib/python/libpasteurize/fixes/fix_features.py ;szFixFeatures.cs2tt||}z |d=Wnty,Yn0|S)Nnode)superrmatch Exception)selfrZto_ret __class__rrr@s   zFixFeatures.matchcCsZ|D]P}||jvrqq|j|}|jdkr2|j}n|j}|||d|j|qdS)N3)reason)features_warnedfeaturesrZcannot_convertwarningZ message_textadd)rrresultsZ feature_nameZ curr_featureZfailrrr transformKs   zFixFeatures.transform) __name__ __module__ __qualname__Z run_ordersetr rFEATURESr!ZPATTERNrr% __classcell__rrrrr3s rN) __doc__Z feature_baserrZlib2to3rr*ZBaseFixrrrrrs *