o
    ?Hh                     @   sp   d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	 ddl
mZmZmZ edZG d	d
 d
ejZdS )a  
For the ``future`` package.

Adds this import line:

    from past.builtins import str as oldstr

at the top and wraps any unadorned string literals 'abc' or explicit byte-string
literals b'abc' in oldstr() calls so the code has the same behaviour on Py3 as
on Py2.6/2.7.
    )unicode_literalsN)
fixer_base)token)syms)future_importtouch_import_topwrap_in_fn_callz[^uUrR]?[\'\"]c                   @   s   e Zd ZdZdZdd ZdS )FixOldstrWrapTSTRINGc                 C   s\   |j tjkr*tdd| t|jr,| }d|_d|j |_t	d|g|jd}|S d S d S )Nz
past.typesoldstr b)prefix)
typer   r
   r   _literal_rematchvaluecloner   r   )selfnoderesultsnewwrapped r   a/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/libfuturize/fixes/fix_oldstr_wrap.py	transform   s   zFixOldstrWrap.transformN)__name__
__module____qualname__BM_compatiblePATTERNr   r   r   r   r   r	      s    r	   )__doc__
__future__r   relib2to3r   lib2to3.pgen2r   lib2to3.fixer_utilr   libfuturize.fixer_utilr   r   r   compiler   BaseFixr	   r   r   r   r   <module>   s    
