o
    ,º]¾  ã                   @   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   ú^/var/www/html/myproject/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    
