a
    6Rh	                     @   sl   d Z ddlZddlZddlZddlZddlmZ dZdZdZ	dZ
dZd	d
 ZdddZdddZdd ZdS )zX
Re-implementation of find_module and get_frozen_object
from the deprecated imp module.
    N)module_from_spec               c                 C   s(   t |trtj jntjj}|| |S )N)
isinstancelist	importlib	machinery
PathFinder	find_specutil)modulepathsfinder r   E/opt/python-3.9.24/usr/lib/python3.9/site-packages/setuptools/_imp.pyr      s
    r   c           	      C   sR  t | |}|du r td|  |js@t|dr@tjd|j}d}d}t|jt	}|j
dksr|rt|jtjjrt}d}d }}n|j
dks|rt|jtjjrt}d}d }}n|jr6|j
}tj|d	 }|tjjv rd
nd}|tjjv rt}t|}n0|tjjv r"t}t|d}n|tjjv rBt}nd}d }}|||||ffS )z7Just like 'imp.find_module()', but with package supportNCan't find submodule_search_locationsz__init__.pyfrozen zbuilt-inr   rrb)r   ImportErrorhas_locationhasattrr
   r   spec_from_loaderloaderr   typeorigin
issubclassr   FrozenImporter	PY_FROZENBuiltinImporter	C_BUILTINospathsplitextSOURCE_SUFFIXES	PY_SOURCEtokenizeopenBYTECODE_SUFFIXESPY_COMPILEDEXTENSION_SUFFIXESC_EXTENSION)	r   r   speckindfileZstaticr(   suffixmoder   r   r   find_module   sR    


r7   c                 C   s(   t | |}|std|  |j| S Nr   )r   r   r   get_code)r   r   r2   r   r   r   get_frozen_objectL   s    
r:   c                 C   s$   t | |}|std|  t|S r8   )r   r   r   )r   r   infor2   r   r   r   
get_moduleS   s    
r<   )N)N)__doc__importlib.machineryr
   importlib.utilr'   r,   r   r+   r/   r1   r&   r$   r   r7   r:   r<   r   r   r   r   <module>   s   	
0
