✏️ 正在编辑: importer.cpython-312.pyc
路径:
/opt/hc_python/lib/python3.12/site-packages/nose/__pycache__/importer.cpython-312.pyc
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
� :��gZ � �� � d Z ddlZddlZddlZddlmZ ddlmZmZm Z m Z ej e� Z ej j Z G d� de� Zd d�Zd � Zy# e$ r d� ZY �w xY w)a: Implements an importer that looks only in specific path (ignoring sys.path), and uses a per-path cache in addition to sys.modules. This is necessary because test modules in different directories frequently have the same names, which means that the first loaded would mask the rest when using the builtin importer. � N)�Config)�find_module�load_module�acquire_lock�release_lockc �� � t j j t j j | � � t j j t j j |� � k( S �N)�os�path�normcase�realpath)�src�dsts �</opt/hc_python/lib/python3.12/site-packages/nose/importer.py� _samefiler sN � ���� � ����!1�!1�#�!6�7���� � ����!1�!1�#�!6�7�8� 9� c �0 � e Zd ZdZdd�Zd� Zd� Zd� Zd� Zy) �Importerz�An importer class that does only path-specific imports. That is, the given module is not searched for on sys.path, but only at the path or in the directory specified. Nc �* � |� t � }|| _ y r )r �config)�selfr s r �__init__zImporter.__init__ s � ��>��X�F���r c � � t j j t j j |� � j t j � }|j d� }|d dk( r|j � |dt |� }t j j |� }| j ||� S )z�Import a dotted-name package whose tail is at path. In other words, given foo.bar and path/to/foo/bar.py, import foo from path/to/foo then bar from path/to/foo/bar, returning bar. �.����__init__.pyN) r r �normpath�abspath�split�sep�pop�len�join� importFromDir)r r �fqname� path_parts� name_parts�dir_paths r �importFromPathzImporter.importFromPath"