Your IP : 216.73.216.213
B
E�W8! � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZmZm Z ddl
mZmZm
Z
mZ ddlmZ ddlmZ ee�ZG dd � d e�Ze r�d
d� Zndd� Zd
d� Zddd�Zdd� Zdd� ZdS )zExecute files of Python code.� N)�BUILTINS)�PYC_MAGIC_NUMBER�imp�importlib_util_find_spec)�ExceptionDuringRun�NoCode�NoSource�isolate_module)�compile_unicode)�get_python_sourcec @ s e Zd ZdZdd� ZdS )�DummyLoaderzzA shim for the pep302 __loader__, emulating pkgutil.ImpLoader.
Currently only implements the .fullname attribute
c G s
|| _ d S )N)�fullname)�selfr
�_args� r �D/opt/alt/python37/lib64/python3.7/site-packages/coverage/execfile.py�__init__ s zDummyLoader.__init__N)�__name__�
__module__�__qualname__�__doc__r r r r r r s r c
C s� yt | �}W n. tk
r: } ztt|���W dd}~X Y nX |sNtd| f ��|j}|j}|�d�r�| �d�s�| d }t |�}|s�td|| f ��|j}|j}|�d�d }||fS ) z�Find the module named `modulename`.
Returns the file path of the module, and the name of the enclosing
package.
NzNo module named %rz__init__.pyr z .__main__zCNo module named %s; %r is a package and cannot be directly executed�.r )r �ImportErrorr �str�origin�name�endswith�
rpartition)�
modulename�spec�err�pathname�packagenameZmod_mainr r r �find_module s&