
    Fwgs
                     V    d Z ddlmZmZ ddlmZ g dZ G d dej                        Zy)	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* >z2.7)numberszimport_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	   )
formattingz<power< any trailer< '.' 'format' > trailer< '(' any* ')' > >r	   )nonlocalzglobal_stmt< 'nonlocal' any* >3.0)with_tracebackztrailer< '.' 'with_traceback' >r   c                       e Zd ZdZ e       Z eeD  cg c]  \  }}}t        |||       c}}}}}       Z	e	j                  Z
fdZd ZxZS c c}}}}} w )FixFeatures	   c                 V    t         t        |   |      }	 |d= |S # t        $ r Y |S w xY w)Nnode)superr   match	Exception)selfr   to_ret	__class__s      W/var/www/horilla/myenv/lib/python3.12/site-packages/libpasteurize/fixes/fix_features.pyr   zFixFeatures.match@   sB    {D/5	w
 	  	 		s    	((c                    |D ]{  }|| j                   v r| j                  |   }|j                  dk\  r| j                  }n| j                  } |||j                                | j                   j                  |       } y )N3)reason)features_warnedfeaturesversioncannot_convertwarningmessage_textadd)r   r   resultsfeature_namecurr_featurefails         r   	transformzFixFeatures.transformK   sy    # 
	7Lt333#}}\:''4/..D<<DT,";";"=>$$((6
	7    )__name__
__module____qualname__	run_ordersetr    r   FEATURESr   r!   PATTERNr   r+   __classcell__).0namepatternr"   r   r   s   00000@r   r   r   3   sh    I eO :BD D 6gw !w8 D EH G	7!Ds   Ar   N)	__doc__feature_baser   r   lib2to3r   r2   BaseFixr    r,   r   <module>r=      s,   
 , (T#7*$$ #7r,   