File: //usr/local/lib/python3.10/dist-packages/numpy/f2py/tests/__pycache__/util.cpython-310.pyc
o
���g�+ � @ sx d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
mZ ddlmZ ddlmZ ddlmZmZ ddlmZ dadaejd kriee�jjjZee�d
��Zdd� Z d
d� Z!dd� Z"dd� Z#e#g g g dfdd��Z$e#g g g ddfdd��Z%da&dd� Z'dd� Z(dd� Z)dd� Z*e#dd � �Z+G d!d"� d"�Z,d#d$� Z-ej.d%d&� �Z/dS )'z�
Utility functions for
- building and importing modules on test time, using a temporary location
- detecting if compilers are present
- determining paths to tests
� N)�Path)�asstr)� asunicode)�temppath�IS_WASM)�
import_modulei �cygwinz**/*.dllc C sZ t d ur+ztj�t � W n ty Y nw zt�t � W n ty& Y nw d a d S d S �N)�_module_dir�sys�path�remove�
ValueError�shutil�rmtree�OSError� r r �@/usr/local/lib/python3.10/dist-packages/numpy/f2py/tests/util.py�_cleanup( s ���r c C s6 t d u rt�� a t�t� t tjvrtj�dt � t S �Nr ) r
�tempfile�mkdtemp�atexit�registerr r r �insertr r r r �get_module_dir6 s
r c C s, t � dt } td7 a| tjv rtd��| S )Nz_test_ext_module_%d� z%Temporary module name already in use.)r �_module_numr �modules�RuntimeError)�namer r r �get_temp_module_name@ s
r! c s i �� �fdd�}� j |_ |S )Nc
sh t | |f�}|�vr'z� | i |���|<