|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/lib2to3/fixes/__pycache__/ |
U
?��g � @ sV d Z ddlmZ ddlmZmZmZmZmZm Z m
Z
mZmZm
Z
G dd� dej�ZdS )zoFixer for execfile.
This converts usages of the execfile function into calls to the built-in
exec() function.
� )�
fixer_base)
�Comma�Name�Call�LParen�RParen�Dot�Node�ArgList�String�symsc @ s e Zd ZdZdZdd� ZdS )�FixExecfileTz�
power< 'execfile' trailer< '(' arglist< filename=any [',' globals=any [',' locals=any ] ] > ')' > >
|
power< 'execfile' trailer< '(' filename=any ')' > >
c C s. |st �|d }|�d�}|�d�}|jd jd �� }t|�� t� tdd�g|d�}ttj t
d�|g�}ttjt� t
d �g�ttjt
� t� g�g} |g| }
|�� }d|_td
d�}|
t� |t� |g }
tt
d�|
d�}|g}|d k r�|�t� |�� g� |d k �r|�t� |�� g� tt
d
�||jd�S )N�filename�globals�locals���z"rb"� )Zrparen�open�readz'exec'�compile� �exec)�prefix)�AssertionError�getZchildrenZcloner
r r r r Zpowerr Ztrailerr r r r r �extend)�selfZnode�resultsr r r Zexecfile_parenZ open_argsZ open_callr Z open_exprZfilename_argZexec_strZcompile_argsZcompile_call�args� r �9/opt/cppython/lib/python3.8/lib2to3/fixes/fix_execfile.py� transform s0
��
zFixExecfile.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr! r r r r r
s r
N)�__doc__r r Z
fixer_utilr r r r r r r r
r r ZBaseFixr
r r r r �<module> s 0