HEX
Server: Apache
System: Linux bd12.noc223.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: handcraf (1693)
PHP: 8.1.28
Disabled: NONE
Upload Files
File: //opt/alt/python312/lib64/python3.12/test/test_zoneinfo/__pycache__/_support.cpython-312.opt-1.pyc
�

�h�e����ddlZddlZddlZddlZddlZddlmZej�Zej�Z	ej�Z
d�Zed��Zejd��ZGd�dej�Zy)�N)�import_fresh_modulec����tj��tjd�|��tj|���fd��}|S)z;Decorator that ensures a function is only ever called once.Nc�B���5��cddd�S#1swYyxYw�N�)�cached�locks���B/opt/alt/python312/lib64/python3.12/test/test_zoneinfo/_support.py�innerzcall_once.<locals>.inners ���
�	��8�	�	�	�s��)�	threading�Lock�	functools�	lru_cache�wraps)�frrr	s  @@r
�	call_oncer
sH����>�>��D�
&�Y�
 �
 ��
&�q�
)�F��_�_�Q������L�c�.�ddl}tddg��}||fS)u�Retrieve two copies of zoneinfo: pure Python and C accelerated.

    Because this function manipulates the import system in a way that might
    be fragile or do unexpected things if it is run many times, it uses a
    `call_once` decorator to ensure that this is only ever called exactly
    one time — in other words, when using this function you will only ever
    get one copy of each module rather than a fresh import each time.
    rN�zoneinfo�	_zoneinfo)�blocked)rr)�c_module�	py_modules  r
�get_modulesrs �� �#�J��
�F�I��h��rc#�K�t�}tjjd|�}|tjd<d��||ur|tjd<ytjj	d�y�w)z�Make sure sys.modules["zoneinfo"] refers to `module`.

    This is necessary because `pickle` will refuse to serialize
    an type calling itself `zoneinfo.ZoneInfo` unless `zoneinfo.ZoneInfo`
    refers to the same object.
    rN)�object�sys�modules�get�pop)�module�NOT_PRESENT�old_zoneinfos   r
�set_zoneinfo_moduler$+sZ�����(�K��;�;�?�?�:�{�;�L�$�C�K�K�
��	��;�&�".����J�������
�#�s�A:A<c�R��eZdZe�fd��Zejdefd��Z�xZ	S)�ZoneInfoTestBasec�X��|jj|_t�|��yr)r!�ZoneInfo�klass�super�
setUpClass)�cls�	__class__s �r
r+zZoneInfoTestBase.setUpClass?s����J�J�'�'��	�
���rTc#�K�d�}|5|r|�}dtjd<|jj}	|jj	|�d��|rJtjjd�j
�D]\}}|tj|<�|jj	|�	ddd�y#|rJtjjd�j
�D]\}}|tj|<�|jj	|�wxYw#1swYyxYw�w)Nc��i}ttj�D]=}|jdd�ddk7r�tjj	|�||<�?|S)N�.�r�tzdata)�listrr�splitr )�tzdata_modules�modnames  r
�pop_tzdata_modulesz;ZoneInfoTestBase.tzpath_context.<locals>.pop_tzdata_modulesFs[���N�����,�
C���=�=��a�(��+�x�7��*-�+�+�/�/�'�*B��w�'�	
C�"�!rr2)rrr!�TZPATH�reset_tzpathr �items)	�self�tzpath�block_tzdatar	r7r5�old_pathr6r!s	         r
�tzpath_contextzZoneInfoTestBase.tzpath_contextDs����	"��	3��"4�!5��(,����H�%��{�{�)�)�H�	
3����(�(��0����K�K�O�O�H�-�+9�+?�+?�+A�6����/5����G�,�6����(�(��2�)	3�	3�� ��K�K�O�O�H�-�+9�+?�+?�+A�6����/5����G�,�6����(�(��2��)	3�	3�s5�E�3D8�C�A'D8�	E�A)D5�5D8�8E�=E)
�__name__�
__module__�__qualname__�classmethodr+�
contextlib�contextmanager�TZPATH_LOCKr?�
__classcell__)r-s@r
r&r&>s4����������26�[�3��3rr&)rDrrr�unittest�test.support.import_helperrr
�OS_ENV_LOCKrF�TZPATH_TEST_LOCKrrrEr$�TestCaser&rrr
�<module>rMs�����
���:��i�n�n����i�n�n���!�9�>�>�#��
��
��
� ���$��$�$&3�x�(�(�&3r