File: //usr/local/lib/python3.10/test/support/__pycache__/import_helper.cpython-310.opt-2.pyc
o
�i8 � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZddlm Z e j
ddd��Zdd� Zd d
� Z
dd� Zddd�dd�Zdd� Zd dd�ZG dd� de�ZG dd� de�Zdd� Zdd� ZdS )!� N� )�unlinkTc c sT � | r%t �� � t �ddt� d V W d � d S 1 sw Y d S d V d S )N�ignorez.+ (module|package))�warnings�catch_warnings�filterwarnings�DeprecationWarning)r � r �7/usr/local/lib/python3.10/test/support/import_helper.py�_ignore_deprecated_imports
s �
�"�
r c C s$ zt j| = W d S ty Y d S w �N)�sys�modules�KeyError)�namer r r
�unload s
�r c C sV t | � tjD ] }tj�|| d �}t|d � dD ]}ttjj||d�� qqd S )Nz.py�c)� r � )�optimization) r r
�path�os�joinr � importlib�util�cache_from_source)�modname�dirname�source�optr r r
�forget$ s
��r c C sD t j�| �}tj�tj�| ��}tj�|| d �}t� ||� |S )Nr )
r r r r r r �abspathr �shutil�move)r Zpyc_fileZup_oneZ
legacy_pycr r r
�make_legacy_pyc4 s r$ Fr )�required_onc C st t |��+ z
t�| �W W d � S ty/ } ztj�t|��r$� t� t
|���d }~ww 1 s3w Y d S r )r r �
import_module�ImportErrorr
�platform�
startswith�tuple�unittestZSkipTest�str)r �
deprecatedr% �msgr r r
r&