Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_compileall.cpython-311.pyc |
�
�Ke(� � �^ � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl
Z
d dlZd dlZd dl
Zd dlZd dlZd dlmZmZ d dlmZ d dlmZ e� � dZn# eef$ r dZY nw xY wd dlmZ d dlmZ d d lmZ d d
lmZ d dlm Z d� Z!d
� Z"d� Z# G d� d� � Z$ G d� de$ej% e d�� � Z& G d� de$ej% e d�� � Z' ej( ej) d� � G d� dej% � � � � Z* G d� d� � Z+ G d� de+ej% e d�� � Z, G d� de+ej% e d�� � Z- ej e.ed� � d � � G d!� d"� � � � Z/ G d#� d$e/ej% e d�� � Z0 G d%� d&e/ej% e d�� � Z1e2d'k r ej3 � � dS dS )(� N)�mock�
skipUnless)�ProcessPoolExecutor)�_check_system_limitsTF)�support)� os_helper)�
script_helper)�without_source_date_epoch)�SourceDateEpochTestMetac �L � |sd}t j � | |�� � S )N� ��optimization)� importlib�util�cache_from_source)�script�opts �>/usr/local/apps/python3/lib/python3.11/test/test_compileall.py�get_pycr # s* � �� ����>�+�+�F��+�E�E�E� c � � � � fd�dD � � S )Nc �0 �� g | ]}t �|� � ��S � )r )�.0r r s �r �
<listcomp>zget_pycs.<locals>.<listcomp>+ s# �� �6�6�6�S�G�F�C� � �6�6�6r �r � � r �r s `r �get_pycsr! * s �� �6�6�6�6�I�6�6�6�6r c �r � t j | � � j }t j |� � j }||k S )z8Returns True if two files have the same inode (hardlink))�os�stat�st_ino)� filename1� filename2�inode1�inode2s r �is_hardlinkr* . s1 � �
�W�Y�
�
�
&�F�
�W�Y�
�
�
&�F��V��r c � � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
d� Zd
� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z eed� � ej d� � d� � � � � Zd� Z eed� � ej d� � d� � � � � Z eed� � ej d� � ej d� � d� � � � � � � Z eed� � ej dd�� � ej d� � d� � � � � � � Z d � Z!d!d"�d#�Z"d$� Z# eed� � d%� � � Z$d&� Z% eed� � d'� � � Z&d(� Z'd)� Z(d*� Z)d+� Z*d,� Z+e,j- d-� � � Z.dS ).�CompileallTestsBasec �` � t j � � | _ t j � | j d� � | _ t j � | j � � | _
t | j dd�� � 5 }|� d� � d d d � � n# 1 swxY w Y t j � | j d� � | _
t j � | j
� � | _ t j | j | j
� � t j � | j d� � | _ t j | j � � t j � | j d� � | _ t j | j | j � � d S ) N�_test.py�w�utf-8��encodingzx = 123
z _test2.py�_subdirz _test3.py)�tempfile�mkdtemp� directoryr# �path�join�source_pathr r r �bc_path�open�write�source_path2�bc_path2�shutil�copyfile�subdirectory�mkdir�source_path3��self�files r �setUpzCompileallTestsBase.setUp7 st � �!�)�+�+����7�<�<���
�C�C��� �~�7�7��8H�I�I���
�$�"�C�'�
:�
:�
:� $�d��J�J�{�#�#�#� $� $� $� $� $� $� $� $� $� $� $���� $� $� $� $��G�L�L����E�E���!��8�8��9J�K�K��
����(�$�*;�<�<�<��G�L�L����C�C���
���"�#�#�#��G�L�L��):�K�H�H������(�$�*;�<�<�<�<�<s �B%�%B)�,B)c �8 � t j | j � � d S �N�r? �rmtreer6 �rE s r �tearDownzCompileallTestsBase.tearDownE � � ��
�d�n�%�%�%�%�%r c �� � t j � | j d� � | _ t | j dd�� � 5 }|� d� � d d d � � d S # 1 swxY w Y d S )Nz_test_bad.pyr/ r0 r1 zx (
)r# r7 r8 r6 �bad_source_pathr; r<