����JFIF���������
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
imh-python
/
lib
/
python3.9
/
__pycache__
/
Filename :
runpy.cpython-39.pyc
back
Copy
a ����_�f�/����������������������@���s��d�Z�ddlZddlZddlZddlZddlZddlZddlm Z m Z �ddgZG�dd��de�Z G�dd ��d e�Zd d d�Zd!dd �Zefdd�ZG�dd��de�Zd"dd�Zd#dd�Zefdd�Zdd��Zd$dd�Zedk�reej�dk���r�edejd��nejd=�eejd���dS�)%aZ��runpy.py - locating and running Python code using the module namespace Provides support for locating and running Python scripts using the Python module namespace instead of the native filesystem. This allows Python code to play nicely with non-filesystem based PEP 302 importers when locating support scripts as well as when importing modules. �����N)� read_code�get_importer� run_module�run_pathc�������������������@���s(���e�Zd�ZdZdd��Zdd��Zdd��ZdS�) �_TempModulezCTemporarily replace a module in sys.modules with an empty namespacec�����������������C���s���||�_�t�|�|�_g�|�_d�S��N)�mod_name�types� ModuleType�module� _saved_module��selfr�����r����&/opt/imh-python/lib/python3.9/runpy.py�__init__���s����z_TempModule.__init__c�����������������C���s@���|�j�}z|�j�tj|���W�n�ty.���Y�n0�|�jtj|<�|�S�r���)r���r����append�sys�modules�KeyErrorr���r ���r���r���r���� __enter__ ���s����z_TempModule.__enter__c�����������������G���s.���|�j�r|�j�d�tj|�j<�n tj|�j=�g�|�_�d�S��Nr���)r���r���r���r����r����argsr���r���r����__exit__)���s���� z_TempModule.__exit__N)�__name__� __module__�__qualname__�__doc__r���r���r���r���r���r���r���r������s��� r���c�������������������@���s$���e�Zd�Zdd��Zdd��Zdd��ZdS�)�_ModifiedArgv0c�����������������C���s���||�_�t���|�_|�_d�S�r���)�value�object�_saved_value� _sentinel)r���r ���r���r���r���r���1���s����z_ModifiedArgv0.__init__c�����������������C���s0���|�j�|�jurtd��tjd�|�_�|�jtjd<�d�S�)NzAlready preserving saved valuer���)r"���r#����RuntimeErrorr����argvr ���)r���r���r���r���r���5���s����z_ModifiedArgv0.__enter__c�����������������G���s���|�j�|�_|�jtjd<�d�S�r���)r#���r ���r"���r���r%���r���r���r���r���r���;���s����z_ModifiedArgv0.__exit__N)r���r���r���r���r���r���r���r���r���r���r���0���s���r���c����������� ��� ���C���sn���|dur|��|��|du�r(d}|}d} n |j}|j}|j} |du�rH|j}|j�||| d|||d��t|�|��|S�)z)Helper to run code in nominated namespaceN)r����__file__� __cached__r���� __loader__�__package__�__spec__)�update�loader�origin�cached�parent�exec) �codeZrun_globals�init_globalsr����mod_spec�pkg_name�script_namer,����fnamer.���r���r���r���� _run_code@���s*���� � r7���c����������� ��� ���C���s����|du�r|n|j�}t|��T}t|��,�|jj}t|�||||||��W�d����n1�sV0����Y��W�d����n1�st0����Y��|���S�)z5Helper to run code in new namespace with sys modifiedN)r-���r���r���r����__dict__r7����copy) r1���r2���r���r3���r4���r5���r6����temp_module�mod_globalsr���r���r����_run_module_codeZ���s�����@r<���c����������� ������C���sd��|���d�r|d��|��d�\}}}|r�zt|��W�nJ�ty|�}�z2|jd�u�sf|j|krh|��|jd��sh��W�Y�d�}~n d�}~0�0�tj�|��}|d�ur�t|d�s�ddl m }�dj|�|d�}|t|���zt j�|��}W�nv�ttttf�yH�} �zTd}|��d ��r|d |�d�d����d|���d �7�}||�|�t| �j| ��| �W�Y�d�} ~ n d�} ~ 0�0�|d�u��r`|d|����|jd�u�r�|�dk�s�|��d��r�|d��z|�d�} t| |�W�S��|�y��}�z*|�tjv�r���|d||�f���W�Y�d�}~n d�}~0�0�|j}|d�u��r�|d|����z|�|��}W�n4�t�yB�}�z|t|��|�W�Y�d�}~n d�}~0�0�|d�u��rZ|d|����|�||fS�)N�.z#Relative module names not supported�__path__r���)�warnz�{mod_name!r} found in sys.modules after import of package {pkg_name!r}, but prior to execution of {mod_name!r}; this may result in unpredictable behaviour)r���r4���z:Error while finding module specification for {!r} ({}: {})z.pyz . Try using '���z' instead of 'z' as the module name.zNo module named %s�__main__z .__main__z%Cannot use package as __main__ modulez3%s; %r is a package and cannot be directly executedz0%r is a namespace package and cannot be executedzNo code object available for %s)� startswith� rpartition� __import__�ImportError�namer���r����get�hasattr�warningsr?����format�RuntimeWarning� importlib�util� find_spec�AttributeError� TypeError� ValueError�endswith�typer����submodule_search_locations�_get_module_detailsr,����get_code) r����errorr4����_�eZexistingr?����msg�spec�exZ pkg_main_namer,���r1���r���r���r���rU���h���sj���� ��� 0 � �$ rU���c�������������������@���s���e�Zd�ZdZdS�)�_ErrorzBError that _run_module_as_main() should report without a tracebackN)r���r���r���r���r���r���r���r���r]�������s���r]���Tc�������������� ���C���s����z0|s|�dkr t�|�t�\}�}}ntt�\}�}}W�n<�tyl�}�z$dtj|f�}t�|��W�Y�d}~n d}~0�0�tjd�j}|r�|jtj d<�t ||dd|�S�)a���Runs the designated module in the __main__ namespace Note that the executed module will have full access to the __main__ namespace. If this is not desirable, the run_module() function should be used to run the module code in a fresh namespace. At the very least, these variables in __main__ will be overwritten: __name__ __file__ __cached__ __loader__ __package__ rA���z%s: %sNr���)rU���r]����_get_main_module_detailsr���� executable�exitr���r8���r-���r%���r7���)r���Z alter_argvr3���r1����excrZ���Zmain_globalsr���r���r����_run_module_as_main����s���� �rb���Fc�����������������C���s@���t�|��\}�}}|du�r|�}|r,t||||�S�t|i�|||�S�dS�)znExecute a module's code without importing it Returns the resulting top level namespace dictionary N)rU���r<���r7���)r���r2����run_nameZ alter_sysr3���r1���r���r���r���r�������s����c�������������� ���C���s����d}t�j|�}t�j|=�zpzt|�W�W�|t�j|<�S��tyx�}�z2|t|�v�rb|�d|t�jd�f��|���W�Y�d�}~n d�}~0�0�W�|t�j|<�n|t�j|<�0�d�S�)NrA���zcan't find %r module in %rr���)r���r���rU���rE����str�path)rW���Z main_nameZ saved_mainra���r���r���r���r^�������s ���� ���r^���c�����������������C���s����t�j�t��|��}t�|��}t|�}W�d�����n1�s:0����Y��|d�u�r�t�|�� }t|���|d�}W�d�����n1�s|0����Y��||fS�)Nr0���) �osre����abspath�fsdecode�io� open_coder����compile�read)rc���r6���Zdecoded_path�fr1���r���r���r����_get_code_from_file����s����&.rn���c�����������������C���s���|du�rd}|��d�d�}t|��}d}t|�jdkrFt|�jdkrFd}t|td��sX|rxt||��\}}t|||||d �S�tj � d|���z�t��\}} }t|���} t |���d�| jj}t||||| |����W��d����W��d����W�ztj �|���W�S��t�y���Y�S�0�S�1��s0����Y��W�d����n1��s20����Y��W�ztj �|���W�n�t�yb���Y�n0�n(ztj �|���W�n�t�y����Y�n0�0�dS�) a_��Execute code located at the specified filesystem location Returns the resulting top level namespace dictionary The file path may refer directly to a Python script (i.e. one that could be directly executed with execfile) or else it may refer to a zipfile or directory containing a top level __main__.py script. Nz <run_path>r=���r���FZimpZNullImporterT)r4���r5���)rC���r���rS���r���r���� isinstancern���r<���r���re����insertr^���r���r���r���r8���r7���r9����removerQ���)Z path_namer2���rc���r4���ZimporterZis_NullImporterr1���r6���r���r3���r:���r;���r���r���r���r�������sH���� � ��$�6�rA�������z!No module specified for execution)�file)NNNNN)NNNNN)T)NNF)NN)r���r���Zimportlib.machineryrL����importlib.utilri���r ���rf���Zpkgutilr���r����__all__r!���r���r���r7���r<���rE���rU���� Exceptionr]���rb���r���r^���rn���r���r����lenr%����print�stderrr���r���r���r����<module>���sB�������� ���� = ��� 1