Ë
    êmxiã  ã                   óD  — d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
mZ  ej                  dej                  ej                     ¬«      Z ej                   ej"                  dk7  xs ej                  dk(  d«      Z ej                   dej&                  v d	«      Z ej                    ej*                  «       d
k7  xs  ej,                  d«      d«      Zd„ Z ej                    e«        d«      Zd„ Zd„ Ze j8                  d„ «       ZdZdedefd„Zy)é    N)Úbind_unused_portÚ_TestCaseType)ÚboundÚposixÚcygwinznon-unix platformÚ
NO_NETWORKznetwork access disabledÚCPythonÚPy_GIL_DISABLEDzNot CPython implementationc                  ó.  — t         j                  syd } 	 t        j                   t         j                  «      } | j                  d«       	 | �| j                  «        y# t        $ r Y | �| j                  «        yyw xY w# | �| j                  «        w w xY w)NF)z::1r   T)ÚsocketÚhas_ipv6ÚAF_INET6ÚbindÚOSErrorÚclose)Úsocks    úH/home/htdocs/ttos/venv/lib/python3.12/site-packages/tornado/test/util.pyÚ_detect_ipv6r   !   s‰   € Ü�?Š?ð Ø€DðÜ�}‰}œVŸ_™_Ó-ˆØ�	‰	�*Õð ÐØ�J‰JŒLØøô ò ØàÐØ�J‰J�Lð ðûð ÐØ�J‰J�Lð ús#   •4A Á	A<Á&A? Á;A<Á<A? Á?Bzipv6 support not presentc                  ó  — t        «       \  } }| j                  d«       t        j                  «       }|j                  d|f«       | j	                  «       \  }}|j                  «        | j                  «        |j
                  |d   fS )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_addrs        r   Úrefusing_portr   5   sz   € ô +Ó,Ñ€M�4Ø×Ñ˜dÔ#Ü—M‘M“O€MØ×Ñ˜;¨Ð-Ô.Ø%×,Ñ,Ó.Ñ€Dˆ+Ø‡J�J„LØ×ÑÔØ×Ñ ¨Q¡Ð0Ð0ó    c                 ób   — t        | fi |¤Ž}i }t        t        j                  |«      ||«       |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_namespaces        r   Ú	exec_testr+   I   s5   € ô ˜NÑ<¨mÑ<ÐØ€OÜŒ�‰˜Ó	Ð-¨Ô?ØÐr    c               #   óš   K  — t        j                  «       5  t        j                  dt        «       d–— ddd«       y# 1 sw Y   yxY w­w)z/Context manager to ignore deprecation warnings.ÚignoreN)ÚwarningsÚcatch_warningsÚsimplefilterÚDeprecationWarning© r    r   Úignore_deprecationr3   X   s<   è ø€ ô 
×	 Ñ	 Ó	"ñ Ü×Ñ˜hÔ(:Ô;Û÷÷ ñ üs   ‚A—?¶	A¿AÁAzabstract base classÚclsÚreturnc                 ó"   ‡—  G ˆfd„d| «      Š‰S )aõ  Decorator to mark a test class as an "abstract" base class.

    This is different from a regular abstract base class because
    we do not limit instantiation of the class. (If we did, it would
    interfere with test discovery). Instead, we prevent the tests from
    being run.

    Subclasses of an abstract base test are run as normal. There is
    no support for the ``@abstractmethod`` decorator so there is no runtime
    check that all such methods are implemented.

    Note that while it is semantically cleaner to modify the test loader
    to exclude abstract base tests, this is more complicated and would
    interfere with third-party test runners. This approach degrades
    gracefully to other tools such as editor-integrated testing.
    c                   ó,   •‡ — e Zd Zeˆˆ fd„«       Zˆ xZS )ú/abstract_base_test.<locals>.AbstractBaseWrapperc                 ó\   •— | ‰u rt        j                  t        «      ‚t        ‰| �  «        y )N)ÚunittestÚSkipTestÚABT_SKIP_MESSAGEÚsuperÚ
setUpClass)r4   ÚAbstractBaseWrapperÚ	__class__s    €€r   r>   z:abstract_base_test.<locals>.AbstractBaseWrapper.setUpClassx   s,   ø€ àÐ)Ñ)Ü×'Ñ'Ô(8Ó9Ð9ÜÐ% sÑ6Õ8r    )Ú__name__Ú
__module__Ú__qualname__Úclassmethodr>   Ú__classcell__)r@   r?   s   @€r   r?   r8   w   s   ù„ Ø	ô	9ó 
ô	9r    r?   r2   )r4   r?   s    @r   Úabstract_base_testrF   c   s   ø€ ö(9˜cô 9ð Ðr    ) Ú
contextlibÚosÚplatformr   ÚsysÚ	sysconfigr$   Útypingr:   r.   Útornado.testingr   ÚTypeVarÚTypeÚTestCaser   ÚskipIfÚnameÚskipIfNonUnixÚenvironÚskipIfNoNetworkÚpython_implementationÚget_config_varÚskipNotCPythonr   ÚskipIfNoIPv6r   r+   Úcontextmanagerr3   r<   rF   r2   r    r   ú<module>r[      s.  ðÛ Û 	Û Û Û 
Û Û Û Û Û å ,à�—‘˜°f·k±kÀ(×BSÑBSÑ6TÔU€à�—‘Ø‡G�GˆwÑÒ2˜#Ÿ,™,¨(Ñ2Ð4Gó€ð "�(—/‘/ ,°"·*±*Ð"<Ð>WÓX€à �—‘ð #€H×"Ñ"Ó$¨	Ñ1ò 3Ø€y×ÑÐ 1Ó2Ø ó€òð" ˆx�‰¡<£>Ð1Ð3MÓN€ò1ò(ð ×Ññó ðð )Ð ð˜Mð ¨mô r    