HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberPanel/lib64/python3.10/site-packages/tornado/test/__pycache__/util.cpython-310.pyc
o

��hF�@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
e�ejdkp5ejdkd�Z
e�dejvd�Ze�dejvd	�Ze�e��d
kd�Ze�e��dkoeejd
koeejdkd�Zdd�Ze�e�d�Zdd�Zdd�Zdd�Zejdd��ZdS)�N)�bind_unused_port�posix�cygwinznon-unix platform�TRAVISz!timing tests unreliable on travis�
NO_NETWORKznetwork access disabled�CPythonzNot CPython implementation�PyPy)�)��	zpypy3 5.8 has buggy ssl modulecCs�tjsdSd}z/z
t�tj�}|�d�Wntjy+YW|dur)|��dSdSwW|dur5|��dS|dur@|��ww)NF)z::1rT)�socket�has_ipv6�AF_INET6�bind�error�close)�sock�r�G/usr/local/CyberPanel/lib/python3.10/site-packages/tornado/test/util.py�_detect_ipv6*s&����
�rzipv6 support not presentcCsTt�\}}|�d�t��}|�d|f�|��\}}|��|��|j|dfS)z�Returns a local port number that will refuse all connections.

    Return value is (cleanup_func, port); the cleanup function
    must be called to free the port to be reused.
    Tz	127.0.0.1�)r�setblockingr�connect�acceptr)�
server_socket�port�
client_socket�conn�client_addrrrr�
refusing_port>s


rcCs*t|fi|��}i}tt�|�||�|S)z�Execute ``s`` in a given context and return the result namespace.

    Used to define functions for tests in particular python
    versions that would be syntax errors in older versions.
    )�dict�exec�textwrap�dedent)�caller_globals�
caller_locals�s�global_namespace�local_namespacerrr�	exec_testRs	r)cOs:z|j}Wntyt�dd��}Ynw||i|��S)zqCompatibility shim for unittest.TestCase.subTest.

    Usage: ``with tornado.test.util.subTest(self, x=x):``
    cs�dVS)Nr)�a�kwrrr�<lambda>is�zsubTest.<locals>.<lambda>)�subTest�AttributeError�
contextlib�contextmanager)�test�args�kwargsr-rrrr-as
�r-ccsB�t���t�dt�dVWd�dS1swYdS)z/Context manager to ignore deprecation warnings.�ignoreN)�warnings�catch_warnings�simplefilter�DeprecationWarningrrrr�ignore_deprecationms
�
"�r9)r/�os�platformr�sysr"�typing�unittestr5�tornado.testingr�skipIf�name�
skipIfNonUnix�environ�skipOnTravis�skipIfNoNetwork�python_implementation�skipNotCPython�version_info�pypy_version_info�skipPypy3V58r�skipIfNoIPv6rr)r-r0r9rrrr�<module>sD�
����