https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/future/backports/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/future/backports/test/__pycache__/support.cpython-310.pyc
o

,�]��@s�dZddlmZmZmZmZddlmZddlm	Z	m
Z
mZmZm
Z
mZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZeed�sYddlZddlZddlZddlZddlZddl Z zddl!Z!Wne"y�ddl#m!Z!Ynwddl$Z$ddl%Z&ddl'Z'ddl(Z(zej)r�ddl*Z*ddl+Z+nddl,Z*ddl+Z+Wn
e"y�dZ*dZ+Ynwzddl-Z.Wne"y�dZ.Ynwzddl/Z/Wne"y�dZ/Ynwzddl0Z0Wne"y�dZ0Ynwzddl1Z1Wne"y�dZ1Ynwzddl2Z2Wne"�ydZ2Ynwgd�Z3Gd	d
�d
e4�Z5Gdd�de5�Z6Gd
d�dej7�Z8ej9d�dd��Z:d�dd�Z;dd�Z<dd�Z=dd�Z>d�dd�Z?dd�Z@d ZAdZBdaCdaDdZEdZFdaGd!d"�ZHd#d$�ZId%d&�ZJej�Kd'��r�d�d(d)�ZLd*d+�ZMd,d-�ZNd.d/�ZOn	ejPZMejQZNejRZOd0d1�ZPd2d3�ZQd4d5�ZRd6d7�ZSd8d9�ZTej�Kd'��r�ddlUZUddlVZUd:d;�ZWnd<d;�ZWd=d>�ZXd�d?d@�ZYdAdB�ZZdCdD�Z[dEdF�Z\dGdH�Z]dIZ^dJZ_ej`ejafdKdL�Zbe^fdMdN�ZcdOdP�Zded�ZedQZfdRZge�he/dS�Zie�he1dT�Zje�he2dU�Zkej�KdV�ZlejmdVk�rdWZnndXZndY�oene�p��Zne�q�Zrej9d�d[d\��Zseed]��r4ej9d^d_��Zteudfd`da�Zvdbdc�Zwddde�Zxdfdg�Zydhdi�Zzdjdk�Z{Gdldm�dme|�Z}d�dndo�Z~ej9dpdq��ZGdrds�dse|�Z�ej)�rxddl�Z�e�j�j�Z�nddl�Z�e�j�Z�Gdtdu�due��Z�Gdvdw�dwe|�Z�Gdxdy�dye|�Z�e�e�ej�dz�Z�e�ej�ej�dz�Z�e�e�ej�dz�Z�ej9d�d|d}��Z�ej9d~d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�ej9d�d���Z�d�d��Z�d�Z�d�Z�eed���r�d�e�Z�d�Z�e�d�Z�d�d��Z�d�d��Z�d�Z�d�Z�d�d��Z�d�d��Z�d�d��Z�d�Z�d�e�Z�d�e�Z�d�e�Z�ej�Z�d�d��Z�Gd�d��d�e|�Z�d�d�d��Z�d�d��Z�Gd�d��d�e|�Z�d�d��Z�d�d��Z�d�d��Z�d�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d�dÄZ�d�dńZ�d�dDŽZ�d�dɄZ�d�d˄Z�d�d̈́Z�d�dτZ�ej9d�dф�Z�ej9d�dӄ�Z�d�dՄZ�d�dׄZ�Gd�dلd�e&j�jƃZ�Gd�dۄd�e|�Z�da�d�d݄Z�d�d߄Z�da�d�d�Z�d�d�Z�ej�Kd'��r�ej9d�d��Z�nej9d�d��Z�d�d�Z�dS)�zwSupporting definitions for the Python regression tests.

Backported for python-future from Python 3.3 test/support.py.
�)�absolute_import�division�print_function�unicode_literals)�utils)�str�range�open�int�map�listN�skip)�	sysconfig)J�Error�
TestFailed�ResourceDenied�
import_module�verbose�
use_resources�
max_memuse�record_original_stdout�get_original_stdout�unload�unlink�rmtree�forget�is_resource_enabled�requires�requires_freebsd_version�requires_linux_version�requires_mac_ver�find_unused_port�	bind_port�IPV6_ENABLED�	is_jython�TESTFN�HOST�SAVEDCWD�temp_cwd�findfile�create_empty_file�sortdict�check_syntax_error�open_urlresource�check_warnings�CleanImport�EnvironmentVarGuard�TransientResource�captured_stdout�captured_stdin�captured_stderr�time_out�socket_peer_reset�ioerror_peer_reset�run_with_locale�
temp_umask�transient_internet�set_memlimit�
bigmemtest�bigaddrspacetest�BasicTestRunner�run_unittest�run_doctest�threading_setup�threading_cleanup�
reap_children�cpython_only�check_impl_detail�
get_attribute�	swap_item�	swap_attr�requires_IEEE_754�TestHandler�Matcher�can_symlink�skip_unless_symlink�skip_unless_xattr�import_fresh_module�
requires_zlib�
PIPE_MAX_SIZE�failfast�anticipate_failure�run_with_tz�
requires_gzip�requires_bz2�
requires_lzma�suppress_crash_popupc@�eZdZdZdS)rz*Base class for regression test exceptions.N��__name__�
__module__�__qualname__�__doc__�r_r_�?/usr/lib/python3/dist-packages/future/backports/test/support.pyrb�rc@rY)rzTest failed.NrZr_r_r_r`rerarc@rY)rz�Test skipped because it requested a disallowed resource.

    This is raised when a test calls requires() for a resource that
    has not be enabled.  It is used to distinguish between expected
    and unexpected skips.
    NrZr_r_r_r`rhrarTccsR�|r$t���t�ddt�dVWd�dS1swYdSdVdS)z�Context manager to suppress package and module deprecation
    warnings when importing them.

    If ignore is False, this context manager has no effect.�ignorez.+ (module|package)N)�warnings�catch_warnings�filterwarnings�DeprecationWarning)rbr_r_r`�_ignore_deprecated_importsps�
�"�
rgFcCs`t|��"z
t�|�WWd�Sty%}zt�t|���d}~ww1s)wYdS)z�Import and return the module to be tested, raising SkipTest if
    it is not available.

    If deprecated is True, any module or package deprecation messages
    will be suppressed.N)rg�	importlibr�ImportError�unittest�SkipTestr)�name�
deprecated�msgr_r_r`rs

����rcCsZ|tjvr
t|�tj|=ttj�D]}||ks|�|d�r*tj|||<tj|=qdS)zyHelper function to save and remove a module from sys.modules

    Raise ImportError if the module can't be imported.
    �.N)�sys�modules�
__import__r�
startswith)rl�orig_modules�modnamer_r_r`�_save_and_remove_module�s
��rvcCs<d}z	tj|||<Wntyd}Ynwdtj|<|S)z�Helper function to save and block a module in sys.modules

    Return True if the module was in sys.modules, False otherwise.
    TFN�rprq�KeyError)rlrt�savedr_r_r`�_save_and_block_module�s�
rzcCs|rtjSdd�S)z�Decorator to mark a test that is known to be broken in some cases

       Any use of this decorator should have a comment identifying the
       associated tracker issue.
    cS�|S�Nr_��fr_r_r`�<lambda>�sz$anticipate_failure.<locals>.<lambda>)rj�expectedFailure)�	conditionr_r_r`rS�srSr_cCs�t|��qi}g}t||�zEz |D]}t||�q|D]}t||�s(|�|�qt�|�}Wnty:d}YnwW|��D]	\}	}
|
tj	|	<q@|D]}tj	|=qLn|��D]	\}	}
|
tj	|	<qX|D]}tj	|=qdw|Wd�S1sxwYdS)aVImport and return a module, deliberately bypassing sys.modules.
    This function imports and returns a fresh copy of the named Python module
    by removing the named module from sys.modules before doing the import.
    Note that unlike reload, the original module is not affected by
    this operation.

    *fresh* is an iterable of additional module names that are also removed
    from the sys.modules cache before doing the import.

    *blocked* is an iterable of module names that are replaced with None
    in the module cache during the import to ensure that attempts to import
    them raise ImportError.

    The named module and any modules named in the *fresh* and *blocked*
    parameters are saved before starting the import and then reinserted into
    sys.modules when the fresh import is complete.

    Module and package deprecation messages are suppressed during this import
    if *deprecated* is True.

    This function will raise ImportError if the named module cannot be
    imported.

    If deprecated is True, any module or package deprecation messages
    will be suppressed.
    N)
rgrvrz�appendrhrri�itemsrprq)rl�fresh�blockedrmrt�names_to_remove�
fresh_name�blocked_name�fresh_module�	orig_name�module�name_to_remover_r_r`rO�s8



���
��
�$�rOcCs2zt||�}W|Styt�d||f��w)z?Get an attribute, raising SkipTest if AttributeError is raised.zobject %r has no attribute %r)�getattr�AttributeErrorrjrk)�objrl�	attributer_r_r`rF�s��rF�cCs|adSr|)�_original_stdout)�stdoutr_r_r`r�srcCs
tptjSr|)r�rpr�r_r_r_r`r�
rcCs$ztj|=WdStyYdSwr|rw)rlr_r_r`rs
�r�wincCs�||�|r	|}ntj�|�\}}|pd}d}|dkr9t�|�}|r&|s,dS||vs,dSt�|�|d9}|dkstjd|tdd�dS)Nrog����MbP?g�?�z)tests may fail, delete still pending for ���
stacklevel)	�os�path�split�listdir�time�sleeprc�warn�RuntimeWarning)�func�pathname�waitall�dirnamerl�timeout�Lr_r_r`�_waitfor
s$
�
�

�r�cC�ttj|�dSr|)r�r�r)�filenamer_r_r`�_unlink+�r�cCr�r|�r�r��rmdir)r�r_r_r`�_rmdir.r�r�cs*�fdd��t�|dd�ttj|�dS)NcsRt�|�D]!}tj�||�}tj�|�r!t�|dd�t�|�qt�|�qdS)NT�r�)r�r�r��join�isdirr�r�r)r�rl�fullname��
_rmtree_innerr_r`r�2s�z_rmtree.<locals>._rmtree_innerTr�r�)r�r_r�r`�_rmtree1sr�c
CsJzt|�WdSty$}z|jtjtjfvr�WYd}~dSd}~wwr|)r��OSError�errno�ENOENT�ENOTDIR)r��errorr_r_r`rAs���rc
C�Dzt|�WdSty!}z|jtjkr�WYd}~dSd}~wwr|)r�r�r�r�)r�r�r_r_r`r�Is���r�c
Cr�r|)r�r�r�r�)r�r�r_r_r`rQs���rcCs@t�|�}tj�tj�|��}tj�||d�}t�||�|S)alMove a PEP 3147 pyc/pyo file to its legacy pyc/pyo location.

    The choice of .pyc or .pyo extension is done based on the __debug__ flag
    value.

    :param source: The file system path to the source file.  The source file
        does not need to exist, however the PEP 3147 pyc file must exist.
    :return: The file system path to the legacy pyc file.
    T�c)�imp�cache_from_sourcer�r�r��abspathr��rename)�source�pyc_file�up_one�
legacy_pycr_r_r`�make_legacy_pycXs


r�cCsft|�tjD])}tj�||d�}t|d�t|d�ttj|dd��ttj|dd��qdS)z�'Forget' a module was ever imported.

    This removes the module from sys.modules and deletes any PEP 3147 or
    legacy .pyc and .pyo files.
    z.pyr��oT)�debug_overrideFN)rrpr�r�r�rr�r�)rur�r�r_r_r`rhs
�rc	Cs�d}d}Gdd�dtj�}tjj}|��}|st���|�}tj��}|�||t�	|�t�
|�t�	|��}|s;t���t|j|@�S)Nr�c@s.eZdZdejjfdejjfdejjfgZdS)z*_is_gui_available.<locals>.USEROBJECTFLAGS�fInherit�	fReserved�dwFlagsN)r[r\r]�ctypes�wintypes�BOOL�DWORD�_fields_r_r_r_r`�USEROBJECTFLAGS�s



�r�)
r��	Structure�windll�user32�GetProcessWindowStation�WinErrorr�r��GetUserObjectInformationW�byref�sizeof�boolr�)�	UOI_FLAGS�WSF_VISIBLEr��dll�h�uof�needed�resr_r_r`�_is_gui_available}s$
�r�cC�dS)NTr_r_r_r_r`r���cCstduo|tvS)zPTest whether a resource is enabled.  Known resources are set by
    regrtest.py.N)r��resourcer_r_r`r�srcCsV|dkrt�st�d��t�d�j�d�dkrdSt|�s)|dur%d|}t|��dS)z�Raise ResourceDenied if the specified resource is not available.

    If the caller's module is __main__ then automatically return True.  The
    possibility of False being returned occurs when regrtest.py is
    executing.
    �guizCannot use the 'gui' resourcer�r[�__main__Nz"Use of the %r resource not enabled)	r�rjrkrp�	_getframe�	f_globals�getrr)r�rnr_r_r`r�s
�rc���fdd�}|S)z�Decorator raising SkipTest if the OS is `sysname` and the version is less
    than `min_version`.

    For example, @_requires_unix_version('FreeBSD', (7, 2)) raises SkipTest if
    the FreeBSD version is less than 7.2.
    cs$t������fdd��}�|_|S)Ncs�t���kr<t���dd�d}zttt|�d���}Wn	ty%Ynw|�kr<d�tt	���}t
�d�||f���|i|��S)N�-r�rroz(%s version %s or higher required, not %s)�platform�system�releaser��tuplerr
�
ValueErrorr�rrjrk��args�kw�version_txt�version�min_version_txt)r��min_version�sysnamer_r`�wrapper�s���z:_requires_unix_version.<locals>.decorator.<locals>.wrapper��	functools�wrapsr��r�r��r�r��r�r`�	decorator�sz)_requires_unix_version.<locals>.decoratorr_)r�r�rr_rr`�_requires_unix_version�srcG�
td|�S)z�Decorator raising SkipTest if the OS is FreeBSD and the FreeBSD version is
    less than `min_version`.

    For example, @requires_freebsd_version(7, 2) raises SkipTest if the FreeBSD
    version is less than 7.2.
    �FreeBSD�r�r�r_r_r`r��
rcGr)z�Decorator raising SkipTest if the OS is Linux and the Linux version is
    less than `min_version`.

    For example, @requires_linux_version(2, 6, 32) raises SkipTest if the Linux
    version is less than 2.6.32.
    �Linuxrrr_r_r`r�rrc��fdd�}|S)z�Decorator raising SkipTest if the OS is Mac OS X and the OS X
    version if less than min_version.

    For example, @requires_mac_ver(10, 5) raises SkipTest if the OS X version
    is lesser than 10.5.
    cs"t�����fdd��}�|_|S)Ncsztjdkr6t��d}zttt|�d���}Wn	ty Ynw|�kr6d�tt	���}t
�d||f���|i|��S)N�darwinrroz&Mac OS X %s or higher required, not %s)rpr��mac_verr�rr
r�r�r�rrjrkr�)r�r�r_r`r��s
���z4requires_mac_ver.<locals>.decorator.<locals>.wrapperr�r�rrr`r�sz#requires_mac_ver.<locals>.decoratorr_)r�rr_rr`r �sr z	127.0.0.1�::1cCs"t�||�}t|�}|��~|S)a�
Returns an unused port that should be suitable for binding.  This is
    achieved by creating a temporary socket with the same family and type as
    the 'sock' parameter (default is AF_INET, SOCK_STREAM), and binding it to
    the specified host address (defaults to 0.0.0.0) with the port set to 0,
    eliciting an unused ephemeral port from the OS.  The temporary socket is
    then closed and deleted, and the ephemeral port is returned.

    Either this method or bind_port() should be used for any tests where a
    server socket needs to be bound to a particular port for the duration of
    the test.  Which one to use depends on whether the calling code is creating
    a python socket, or if an unused port needs to be provided in a constructor
    or passed to an external program (i.e. the -accept argument to openssl's
    s_server mode).  Always prefer bind_port() over find_unused_port() where
    possible.  Hard coded ports should *NEVER* be used.  As soon as a server
    socket is bound to a hard coded port, the ability to run multiple instances
    of the test simultaneously on the same host is compromised, which makes the
    test a ticking time bomb in a buildbot environment. On Unix buildbots, this
    may simply manifest as a failed test, which can be recovered from without
    intervention in most cases, but on Windows, the entire python process can
    completely and utterly wedge, requiring someone to log in to the buildbot
    and manually kill the affected process.

    (This is easy to reproduce on Windows, unfortunately, and can be traced to
    the SO_REUSEADDR socket option having different semantics on Windows versus
    Unix/Linux.  On Unix, you can't have two AF_INET SOCK_STREAM sockets bind,
    listen and then accept connections on identical host/ports.  An EADDRINUSE
    socket.error will be raised at some point (depending on the platform and
    the order bind and listen were called on each socket).

    However, on Windows, if SO_REUSEADDR is set on the sockets, no EADDRINUSE
    will ever be raised when attempting to bind two identical host/ports. When
    accept() is called on each socket, the second caller's process will steal
    the port from the first caller, leaving them both in an awkwardly wedged
    state where they'll no longer respond to any signals or graceful kills, and
    must be forcibly killed via OpenProcess()/TerminateProcess().

    The solution on Windows is to use the SO_EXCLUSIVEADDRUSE socket option
    instead of SO_REUSEADDR, which effectively affords the same semantics as
    SO_REUSEADDR on Unix.  Given the propensity of Unix developers in the Open
    Source world compared to Windows ones, this is a common mistake.  A quick
    look over OpenSSL's 0.9.8g source shows that they use SO_REUSEADDR when
    openssl.exe is called with the 's_server' option, for example. See
    http://bugs.python.org/issue2550 for more info.  The following site also
    has a very thorough description about the implications of both REUSEADDR
    and EXCLUSIVEADDRUSE on Windows:
    http://msdn2.microsoft.com/en-us/library/ms740621(VS.85).aspx)

    XXX: although this approach is a vast improvement on previous attempts to
    elicit unused ports, it rests heavily on the assumption that the ephemeral
    port returned to us by the OS won't immediately be dished back out to some
    other process when we close and delete our temporary socket but before our
    calling code has a chance to bind the returned port.  We can deal with this
    issue if/when we come across it.
    )�socketr"�close)�family�socktype�tempsock�portr_r_r`r!�s
8r!cCs�|jtjkrM|jtjkrMttd�r|�tjtj�dkrt	d��ttd�r?z|�tjtj
�dkr3t	d��Wn
tjy>Ynwttd�rM|�tjtj
d�|�|df�|��d}|S)a%Bind the socket to a free port and return the port number.  Relies on
    ephemeral ports in order to ensure we are using an unbound port.  This is
    important as many tests may be running simultaneously, especially in a
    buildbot environment.  This method raises an exception if the sock.family
    is AF_INET and sock.type is SOCK_STREAM, *and* the socket has SO_REUSEADDR
    or SO_REUSEPORT set on it.  Tests should *never* set these socket options
    for TCP/IP sockets.  The only case for setting these options is testing
    multicasting via multiple UDP sockets.

    Additionally, if the SO_EXCLUSIVEADDRUSE socket option is available (i.e.
    on Windows), it will be set on the socket.  This will prevent anyone else
    from bind()'ing to our host/port for the duration of the test.
    �SO_REUSEADDRr�zHtests should never set the SO_REUSEADDR socket option on TCP/IP sockets!�SO_REUSEPORTzHtests should never set the SO_REUSEPORT socket option on TCP/IP sockets!�SO_EXCLUSIVEADDRUSEr)rr�AF_INET�type�SOCK_STREAM�hasattr�
getsockopt�
SOL_SOCKETrrrr��
setsockoptr�bind�getsockname)�sock�hostrr_r_r`r"9s"

��
r"c	Cs�tjr>d}z0zt�tjtj�}|�d�WW|r|��dSdStjtjfy,YnwW|r4|��dS|r=|��wwdS)z+Check whether IPv6 is enabled on this host.N)r
rTF)r�has_ipv6�AF_INET6rrrr��gaierror)r r_r_r`�_is_ipv6_enabled^s(
����
�r%i@iz
requires zlibzrequires bz2z
requires lzma�javaz$testz@testz{0}_{1}_tmp�tempcwdc	cs��t��}d}|dur-|}z	t�|�d}Wnty,|s �tjd|tdd�Ynwzt�|�WntyJ|s>�tjd|tdd�Ynwzt��VWt�|�|r_t|�dSdSt�|�|rmt|�ww)a�
    Context manager that temporarily changes the CWD.

    An existing path may be provided as *path*, in which case this
    function makes no changes to the file system.

    Otherwise, the new CWD is created in the current directory and it's
    named *name*. If *quiet* is False (default) and it's not possible to
    create or change the CWD, an error is raised.  If it's True, only a
    warning is raised and the original CWD is used.
    FNTz*tests may fail, unable to create temp CWD �r�z,tests may fail, unable to change the CWD to )	r��getcwd�mkdirr�rcr�r��chdirr)rl�quietr��	saved_dir�is_temporaryr_r_r`r(sD�



��

��
�
�
�r(�umaskc	cs0�t�|�}zdVWt�|�dSt�|�w)z8Context manager that temporarily sets the process umask.N)r�r/)r/�oldmaskr_r_r`r9<s
�
r9cCsntj�|�r|S|durtj�||�}tj}tj�|�g|}|D]}tj�||�}tj�|�r4|Sq!|S)z�Try to find a file on sys.path and the working directory.  If it is not
    found the argument passed to the function is returned (this does not
    necessarily signal failure; could still be the legitimate path).N)r�r��isabsr�rpr��exists)�file�here�subdirr��dn�fnr_r_r`r)Fsr)cCs(t�|tjtjBtjB�}t�|�dS)z>Create an empty file. If the file already exists, truncate it.N)r�r	�O_WRONLY�O_CREAT�O_TRUNCr)r��fdr_r_r`r*Usr*cCs,t|���}dd�|D�}d�|�}d|S)z%Like repr(dict), but in sorted order.cSsg|]}d|�qS)z%r: %rr_)�.0�pairr_r_r`�
<listcomp>]szsortdict.<locals>.<listcomp>z, z{%s})�sortedr�r�)�dictr��	reprpairs�
withcommasr_r_r`r+Zs
r+cCs8ttd�}z
|��W|��tt�S|��tt�w)z`
    Create an invalid file descriptor by opening and closing a file and return
    its fd.
    �wb)r	r%�filenorr�r3r_r_r`�make_bad_fdas

�
rFcCs|�tt|dd�dS)Nz
<test string>�exec)�assertRaises�SyntaxError�compile)�testcase�	statementr_r_r`r,ms
�r,cs0ddlm}m}��dd��|�|�d�d�d}tj�tj�	t
�d|�}���fdd	�}tj�|�rB||�}|dur>|St|�t
d
�td|t�d�|j|d
d�}z,t|d��}	|��}
|
rn|	�|
�|��}
|
scWd�n1sxwYW|��n|��w||�}|dur�|Std|��)Nr)�request�parse�checkr��/����datacsDt|g��Ri���}�dur|S�|�r|�d�|S|��dS�Nr)r	�seekr)r7r~�r�rOr�r_r`�check_valid_file{s
z*open_urlresource.<locals>.check_valid_file�urlfetchz	fetching %s ...rE�)r�rCzinvalid resource %r)�future.backports.urllibrMrN�pop�urlparser�r�r�r�r��__file__r2rr�printr�urlopenr	�read�writerr)�urlr�r��urllib_request�urllib_parser�r7rVr~�out�sr_rUr`r-qs8	
����r-c@s4eZdZdZdd�Zdd�Zedd��Zdd	�Zd
S)�WarningsRecorderzyConvenience wrapper for the warnings list returned on
       entry to the warnings.catch_warnings() context manager.
    cCs||_d|_dSrS��	_warnings�_last)�self�
warnings_listr_r_r`�__init__��
zWarningsRecorder.__init__cCs@t|j�|jkrt|jd|�S|tjjvrdStd||f��)NrQz%r has no attribute %r)�lenrhrir�rc�WarningMessage�_WARNING_DETAILSr�)rj�attrr_r_r`�__getattr__�s
zWarningsRecorder.__getattr__cCs|j|jd�Sr|rg�rjr_r_r`rc�szWarningsRecorder.warningscCst|j�|_dSr|)rnrhrirsr_r_r`�reset�r�zWarningsRecorder.resetN)	r[r\r]r^rlrr�propertyrcrtr_r_r_r`rf�s
rfccs4�t�d�}|j�d�}|r#tjr|��n
tt|��D]}|�	�qt
jdd��}tjd�
d�t|�VWd�n1sAwYt|�}g}|D]5\}}	d}
|dd�D]}|j}t�|t|�tj�rvt|j|	�rvd}
|�|�qZ|
s�|s�|�||	jf�qN|r�td	|d
��|r�td|d
��dS)z�Catch the warnings, then check if all the expected
    warnings have been raised and re-raise unexpected warnings.
    If 'quiet' is True, only re-raise the unexpected warnings.
    r��__warningregistry__T)�recordrc�alwaysNFzunhandled warning %srz)filter (%r, %s) did not catch any warning)rpr�r�r�r�PY3�clearrrnrZrcrdrq�simplefilterrfr�message�re�matchr�I�
issubclass�	__class__�remover�r[�AssertionError)�filtersr,�frame�registry�i�w�reraise�missingrn�cat�seen�warningr_r_r`�_filterwarnings�sD�


�
�
����r�cOs.|�d�}|sdtff}|durd}t||�S)a�Context manager to silence warnings.

    Accept 2-tuples as positional arguments:
        ("message regexp", WarningCategory)

    Optional argument:
     - if 'quiet' is True, it does not fail if a filter catches nothing
        (default True without argument,
         default False if some filters are defined)

    Without argument, it defaults to:
        check_warnings(("", Warning), quiet=True)
    r,�NT)r��Warningr�)r��kwargsr,r_r_r`r.�s


r.c@�(eZdZdZdd�Zdd�Zdd�ZdS)	r/a,Context manager to force import to return a new module reference.

    This is useful for testing module-level behaviours, such as
    the emission of a DeprecationWarning on import.

    Use like this:

        with CleanImport("foo"):
            importlib.import_module("foo") # new reference
    cGsJtj��|_|D]}|tjvr"tj|}|j|krtj|j=tj|=qdSr|)rprq�copy�original_modulesr[)rj�module_names�module_namer�r_r_r`rls



��zCleanImport.__init__cCr{r|r_rsr_r_r`�	__enter__r�zCleanImport.__enter__cGstj�|j�dSr|)rprq�updater��rj�
ignore_excr_r_r`�__exit__�zCleanImport.__exit__N�r[r\r]r^rlr�r�r_r_r_r`r/�s

r/c@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)r0z_Class to help protect the environment variable properly.  Can be used as
    a context manager.cCstj|_i|_dSr|)r��environ�_environ�_changedrsr_r_r`rl&s
zEnvironmentVarGuard.__init__cCs
|j|Sr|)r��rj�envvarr_r_r`�__getitem__*r�zEnvironmentVarGuard.__getitem__cCs*||jvr|j�|�|j|<||j|<dSr|�r�r�r��rjr��valuer_r_r`�__setitem__-s
zEnvironmentVarGuard.__setitem__cCs6||jvr|j�|�|j|<||jvr|j|=dSdSr|r�r�r_r_r`�__delitem__3s


�zEnvironmentVarGuard.__delitem__cCs
|j��Sr|)r��keysrsr_r_r`r�:r�zEnvironmentVarGuard.keyscC�
t|j�Sr|)�iterr�rsr_r_r`�__iter__=r�zEnvironmentVarGuard.__iter__cCr�r|)rnr�rsr_r_r`�__len__@r�zEnvironmentVarGuard.__len__cCs|||<dSr|r_r�r_r_r`�setC�zEnvironmentVarGuard.setcCs
||=dSr|r_r�r_r_r`�unsetFr�zEnvironmentVarGuard.unsetcCr{r|r_rsr_r_r`r�Ir�zEnvironmentVarGuard.__enter__cGsF|j��D]\}}|dur||jvr|j|=q||j|<q|jt_dSr|)r�r�r�r�r�)rjr��k�vr_r_r`r�Ls
�zEnvironmentVarGuard.__exit__N)r[r\r]r^rlr�r�r�r�r�r�r�r�r�r�r_r_r_r`r0!sr0c@r�)	�
DirsOnSysPatha�Context manager to temporarily add directories to sys.path.

    This makes a copy of sys.path, appends any directories given
    as positional arguments, then reverts sys.path to the copied
    settings when the context ends.

    Note that *all* sys.path modifications in the body of the
    context manager, including replacement of the object,
    will be reverted at the end of the block.
    cGs(tjdd�|_tj|_tj�|�dSr|)rpr��original_value�original_object�extend)rj�pathsr_r_r`rlbszDirsOnSysPath.__init__cCr{r|r_rsr_r_r`r�gr�zDirsOnSysPath.__enter__cGs|jt_|jtjdd�<dSr|)r�rpr�r�r�r_r_r`r�jszDirsOnSysPath.__exit__Nr�r_r_r_r`r�Vs
r�c@s*eZdZdZdd�Zdd�Zd	dd�ZdS)
r1z�Raise ResourceDenied if an exception is raised while the context manager
    is in effect that matches the specified exception and attributes.cKs||_||_dSr|)�exc�attrs)rjr�r�r_r_r`rltrmzTransientResource.__init__cCr{r|r_rsr_r_r`r�xr�zTransientResource.__enter__NcCs\|dur*t|j|�r,|j��D]\}}t||�sdSt||�|kr%dSqtd��dSdS)z�If type_ is a subclass of self.exc and value has attributes matching
        self.attrs, raise ResourceDenied.  Otherwise let the exception
        propagate (if any).Nz%an optional resource is not available)r�r�r�r�rr�r)rj�type_r��	tracebackrq�
attr_valuer_r_r`r�{s
��zTransientResource.__exit__)NNNr�r_r_r_r`r1os
r1)r��>@c	
#s�gd�}gd�}td|��|�g��s#dd�|D��dd�|D�����fdd�}t��}zRz|d	ur:t�|�d	VWn;tyy}z/	|j}t|�dkr\t|dt�r\|d}nt|�d
krnt|dt�rn|d}nnqG||��d	}~wwWt�|�d	St�|�w)z�Return a context manager that raises ResourceDenied when various issues
    with the Internet connection manifest themselves as exceptions.))�ECONNREFUSED�o)�
ECONNRESET�h)�EHOSTUNREACH�q)�ENETUNREACH�e)�	ETIMEDOUT�n))�	EAI_AGAIN���)�EAI_FAIL���)�
EAI_NONAME���)�
EAI_NODATA���)�
WSANO_DATAi�*zResource %r is not availablecS�g|]
\}}tt||��qSr_)r�r��r<rl�numr_r_r`r>���z&transient_internet.<locals>.<listcomp>cSr�r_)r�rr�r_r_r`r>�r�cs`t|dd�}t|tj�st|tj�r|�vs|�vr.ts'tj��j	dd��}||_
|�dS)Nr�r�
)r��
isinstancerr�r$rrp�stderrr`r��	__cause__)�err�nr���captured_errnos�denied�
gai_errnosr_r`�filter_error�s
��z(transient_internet.<locals>.filter_errorNTr�rr�)rr�getdefaulttimeout�setdefaulttimeout�IOErrorr�rnr�)	�
resource_namer��errnos�default_errnos�default_gai_errnosr��old_timeoutr��ar_r�r`r:�sD�	��




����r:c
csR�ddl}tt|�}tt||���ztt|�VWtt||�dStt||�w)z�Return a context manager used by captured_stdout/stdin/stderr
    that temporarily replaces the sys stream *stream_name* with a StringIO.rN)�ior�rp�setattr�StringIO)�stream_namer��orig_stdoutr_r_r`�captured_output�s�
r�cC�td�S)z�Capture the output of sys.stdout:

       with captured_stdout() as s:
           print("hello")
       self.assertEqual(s.getvalue(), "hello")
    r��r�r_r_r_r`r2�sr2cCr�)Nr�r�r_r_r_r`r4��r4cCr�)N�stdinr�r_r_r_r`r3�r�r3cCs*t��trt�d�t��t��dS)a�Force as many objects as possible to be collected.

    In non-CPython implementations of Python, this is needed because timely
    deallocation is not guaranteed by the garbage collector.  (Even in CPython
    this can be the case in case of reference cycles.)  This means that __del__
    methods may be called later than expected and weakrefs may remain alive for
    longer than expected.  This function tries its best to force all garbage
    objects to disappear.
    皙�����?N)�gc�collectr$r�r�r_r_r_r`�
gc_collect�s


r�ccs@�t��}t��zdVW|rt��dSdS|rt��wwr|)r��	isenabled�disable�enable)�have_gcr_r_r`�
disable_gcs��
�r�cCsFddl}|�d�p
d}d}|��D]	}|�d�r|}q|dko"|dkS)z,Find if Python was built with optimizations.rN�	PY_CFLAGSr�z-Oz-O0)r�get_config_varr�rs)r�cflags�	final_opt�optr_r_r`�python_is_optimizeds
�r�nP�0n�gettotalrefcount�2P�0Pr�cC�t�t|t�Sr|)�struct�calcsize�_header�_align��fmtr_r_r`�calcobjsizer�rcCrr|)rr	�_vheaderrrr_r_r`�calcvobjsize"r�ri@icCsht�|�}t|�tkr|jt@st|�tkr"t|�jt@r"|tj7}dt|�||f}|�|||�dS)Nz&wrong size for %s: got %d, expected %d)	rp�	getsizeofr�	__flags__�_TPFLAGS_HEAPTYPE�_TPFLAGS_HAVE_GC�	_testcapi�SIZEOF_PYGC_HEAD�assertEqual)�testr��size�resultrnr_r_r`�check_sizeof)s

�rcr�)Ncs$���fdd�}�j|_�j|_|S)Nc
s�zddl}t|��}|�|�}Wnty�d}}Yn�D]}z	|�||�WnYq#z�|i|��W|rG|rH|�||�SSS|rT|rU|�||�wwwrS)�localer��	setlocaler�)r��kwdsr�category�orig_locale�loc)�catstrr��localesr_r`�inner9s*
��z1run_with_locale.<locals>.decorator.<locals>.inner�r[r^�r�r$�r"r#rr`r8sz"run_with_locale.<locals>.decoratorr_)r"r#rr_r'r`r87sr8cr
)Ncs"��fdd�}�j|_�j|_|S)Nc	s�ztj}Wntyt�d��wdtjvrtjd}nd}�tjd<|�z�|i|��W|dur8tjd=n|tjd<t��S|durKtjd=n|tjd<t��w)Nztzset required�TZ)r��tzsetr�rjrkr�r�)r�rr)�orig_tz)r��tzr_r`r$]s(

�




�


z-run_with_tz.<locals>.decorator.<locals>.innerr%r&�r+rr`r\szrun_with_tz.<locals>.decoratorr_)r+rr_r,r`rT[srTi�r�r�cCs�dttdtd�}t�d|tjtjB�}|durtd|f��tt|�	d��||�	d��
��}|a|tkr9t}|t
dkrFtd|f��|adS)Nr-)r��m�g�tz(\d+(\.\d+)?) (K|M|G|T)b?$zInvalid memory limit %rr�r(z$Memory limit %r too low to be useful)�_1M�_1Gr}r~�
IGNORECASE�VERBOSEr�r
�float�group�lower�real_max_memuse�MAX_Py_ssize_t�_2Gr)�limit�sizesr.�memlimitr_r_r`r;�s"�
�$r;c@r�)	�_MemoryWatchdogz`An object which periodically watches the process' memory consumption
    and prints it out.
    cCsdjt��d�|_d|_dS)Nz/proc/{pid}/statm)�pidF)�formatr��getpid�procfile�startedrsr_r_r`rl�s
z_MemoryWatchdog.__init__c
Cs�zt|jd�}Wn!ty)}zt�d�|�t�tj�	�WYd}~dSd}~wwt
d�}tjtj
|g|tjd�|_|��d|_dS)N�rz"/proc not available for stats: {0}zmemory_watchdog.py)r�r�T)r	rBr�rcr�r@r�rpr��flushr)�
subprocess�Popen�
executable�DEVNULL�mem_watchdogrrC)rjr~�e�watchdog_scriptr_r_r`�start�s �
���
z_MemoryWatchdog.startcCs"|jr|j��|j��dSdSr|)rCrJ�	terminate�waitrsr_r_r`�stop�s
�z_MemoryWatchdog.stopN)r[r\r]r^rlrMrPr_r_r_r`r>�s
r>cs���fdd�}|S)aADecorator for bigmem tests.

    'minsize' is the minimum useful size for the test (in arbitrary,
    test-interpreted units.) 'memuse' is the number of 'bytes per size' for
    the test, or a good estimate of it.

    if 'dry_run' is False, it means the test doesn't support dummy runs
    when -M is not specified.
    cs ���fdd����_��_�S)Ncs��j}�j}tsd}n|}ts�s"t||kr"t�d||d��tr=tr=t�tdj||dd��t�}|�	�nd}z
�||�W|rL|�
�SS|rT|�
�ww)Ni�'not enough memory: %.1fG minimum needed�@z* ... expected peak memory use: {peak:.1f}G)�peak)r�memuser8rjrkrr]r@r>rMrP)rjrrT�maxsize�watchdog)�dry_runr~r�r_r`r��s6
���


�
�z.bigmemtest.<locals>.decorator.<locals>.wrapper)rrTr}�rWrTr�r~r�r`r�szbigmemtest.<locals>.decoratorr_)rrTrWrr_rXr`r<�s
!r<cr
)z0Decorator for tests that fill the address space.cs<ttkrtdkrtdkrt�d��t�dtd���|�S)Nl����lz-not enough memory: try a 32-bit build insteadrQrR)rr9rjrkrsr}r_r`r��s���z!bigaddrspacetest.<locals>.wrapperr_rYr_r}r`r=�sr=c@seZdZdd�ZdS)r>cCst��}||�|Sr|)rj�
TestResult)rjrrr_r_r`�run�szBasicTestRunner.runN)r[r\r]r[r_r_r_r`r>�sr>cCr{r|r_)r�r_r_r`�_id�r�r\cCs4|dkrt�st�d�St|�rtSt�d�|��S)Nr�zresource 'gui' is not availablezresource {0!r} is not enabled)r�rjr
rr\r@r�r_r_r`�requires_resources

r]cCstdd�|�S)z9
    Decorator for tests only applicable on CPython.
    T)�cpython)�impl_detail�rr_r_r`rDsrDcKsZtdi|��r	tS|dur(t|�\}}|rd}nd}t|���}|�d�|��}t�|�S)Nz*implementation detail not available on {0}z%implementation detail specific to {0}z or r_)	rEr\�
_parse_guardsr?r�r@r�rjr
)rn�guards�
guardnames�defaultr_r_r`r_s
r_cCsH|sddidfSt|���d}t|���|gt|�ksJ�||fS)Nr^TFr)r�valuesrn)rb�is_truer_r_r`ras

racKs t|�\}}|�t����|�S)a5This function returns True or False depending on the host platform.
       Examples:
          if check_impl_detail():               # only on CPython (default)
          if check_impl_detail(jython=True):    # only on Jython
          if check_impl_detail(cpython=False):  # everywhere except on CPython
    )rar�r��python_implementationr7)rbrdr_r_r`rE%srEcs(ttd�s�St����fdd��}|S)zEDecorator to temporarily turn off tracing for the duration of a test.�gettracec	s:t��}zt�d��|i|��Wt�|�St�|�wr|)rprh�settrace)r�r��original_tracerr_r`r�5s

zno_tracing.<locals>.wrapper)rrpr�r�r�r_rr`�
no_tracing0s

rkcCstt|��S)aDecorator for tests which involve reference counting.

    To start, the decorator does not run the test if is not run by CPython.
    After that, any trace function is unset during the test to prevent
    unexpected refcounts caused by the trace function.

    )rkrDr`r_r_r`�
refcount_test@srlcCsNg}|jD]}t|tj�rt||�|�|�q||�r!|�|�q||_dS)z>Recursively filter test cases in a suite based on a predicate.N)�_testsr�rj�	TestSuite�
_filter_suiter�)�suite�pred�newtestsrr_r_r`roKs


�
rocCs�trtjtjdtd�}nt�}|�|�}|��sNt	|j
�dkr-|js-|j
dd}t|��t	|j�dkrB|j
sB|jdd}t|��d}tsJ|d7}t|��dS)z2Run tests from a unittest.TestSuite-derived class.r�)�	verbosityrRr�rzmultiple errors occurredz!; run in verbose mode for detailsN)
rrj�TextTestRunnerrpr�rRr>r[�
wasSuccessfulrn�errors�failuresr)rp�runnerrr�r_r_r`�
_run_suiteWs"
�
���rycGs�tjtjf}t��}|D]/}t|t�r(|tjvr$|�t�tj|��qt	d��t||�r3|�|�q|�t�
|��qdd�}t||�t|�dS)z1Run tests from unittest.TestCase-derived classes.z)str arguments must be keys in sys.modulescSs6tdurdS|���d�D]}t�|t�rdSq
dS)NTroF)�match_tests�idr��fnmatch�fnmatchcase)rrlr_r_r`�	case_predys�zrun_unittest.<locals>.case_predN)
rjrn�TestCaser�rrprq�addTest�
findTestCasesr��	makeSuiterory)�classes�valid_typesrp�clsr~r_r_r`r?ks



r?cCs`ddl}|durt}nd}|j|||d�\}}|r!td||f��tr,td|j|f�||fS)aRun doctest on the given module.  Return (#failures, #tests).

    If optional argument verbosity is not specified (or is None), pass
    support's belief about verbosity on to doctest.  Else doctest's
    usual behavior is used (it searches sys.argv for -v).
    rN)r�optionflagsz%d of %d doctests failedz,doctest (%s) ... %d tests with zero failures)�doctestr�testmodrr]r[)r�rsr�r�r~r0r_r_r`r@�s�r@cCstj��fSr|)rprqr�r_r_r_r`�
modules_setup�r�r�cCsNdd�tj��D�}tttj��D]}tj��qtj�|�tj�|�dS)NcSs"g|]
\}}|�d�r||f�qS)z
encodings.)rs)r<r�r�r_r_r`r>�s�z#modules_cleanup.<locals>.<listcomp>)rprqr�rrnrZr�)�
oldmodules�	encodingsr�r_r_r`�modules_cleanup�s
r�cCstrt��fSdS)N)r�)�_thread�_countr_r_r_r`rA�s
rAcCs>tsdSd}t|�D]}t��}||krdSt�d�q
dS)N�
r�)r�rr�r�r�)�
nb_threads�
_MAX_COUNT�countr�r_r_r`rB�s�rBcs"ts�St����fdd��}|S)z�Use this function when threads are being used.  This will
    ensure that the threads are cleaned up even when the test fails.
    If threading is unavailable this function does nothing.
    cs$t�}z	�|�Wt|�St|�wr|)rArB)r��keyrr_r`r�szreap_threads.<locals>.decorator)r�r�r�)r�rr_rr`�reap_threads�s
r�cCsHttd�r"d}	zt�|tj�\}}|dkrWdSWnYdSqdS)z�Use this function at the end of test_main() whenever sub-processes
    are started.  This will help ensure that no extra children (zombies)
    stick around to hog resources and create problems when looking
    for refleaks.
    �waitpidrQTrN)rr�r��WNOHANG)�any_processr?�statusr_r_r`rC�s
	���rCc
csz�t||�r%t||�}t|||�zdVWt|||�dSt|||�wt|||�zdVWt||�dSt||�w)amTemporary swap out an attribute with a new object.

    Usage:
        with swap_attr(obj, "attr", 5):
            ...

        This will set obj.attr to 5 for the duration of the with: block,
        restoring the old value at the end of the block. If `attr` doesn't
        exist on `obj`, it will be created and then deleted at the end of the
        block.
    N)rr�r��delattr)r�rq�new_val�real_valr_r_r`rH
s�

rHc	cs^�||vr||}|||<z
dVW|||<dS|||<w|||<z	dVW||=dS||=w)akTemporary swap out an item with a new object.

    Usage:
        with swap_item(obj, "item", 5):
            ...

        This will set obj["item"] to 5 for the duration of the with: block,
        restoring the old value at the end of the block. If `item` doesn't
        exist on `obj`, it will be created and then deleted at the end of the
        block.
    Nr_)r��itemr�r�r_r_r`rG%s�
rGcCst�dd|���}|S)z�Strip the stderr of a Python process from potential debug output
    emitted by the interpreter.

    This will typically be run on the result of the communicate() method
    of a subprocess.Popen object.
    s\[\d+ refs\]\r?\n?�)r}�sub�strip)r�r_r_r`�strip_python_stderr@sr�cCst��S)znReturn a list of command-line arguments reproducing the current
    settings in sys.flags and sys.warnoptions.)rF�_args_from_interpreter_flagsr_r_r_r`�args_from_interpreter_flagsJsr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rJcCstjj�|d�||_dSrS)�logging�handlers�BufferingHandlerrl�matcher)rjr�r_r_r`rlTs
zTestHandler.__init__cCr�)NFr_rsr_r_r`�shouldFlush]r�zTestHandler.shouldFlushcCs|�|�|j�|j�dSr|)r@�bufferr��__dict__)rjrwr_r_r`�emit`s
zTestHandler.emitcKs2d}|jD]}|jj|fi|��rd}|Sq|S)zW
        Look for a saved dict whose keys/values match the supplied arguments.
        FT)r�r��matches)rjr�r�dr_r_r`r�ds
�zTestHandler.matchesN)r[r\r]rlr�r�r�r_r_r_r`rJSs
	rJc@s eZdZdZdd�Zdd�ZdS)rK)rnr|cKs<d}|D]}||}|�|�}|�|||�sd}|Sq|S)a.
        Try to match a single dict with the supplied arguments.

        Keys whose values are strings and which are in self._partial_matches
        will be checked for partial (i.e. substring) matches. You can extend
        this scheme to (for example) do regular expression matching, etc.
        TF)r��match_value)rjr�r�rr�r��dvr_r_r`r�ss
�zMatcher.matchescCsLt|�t|�krd}|St|�tus||jvr||k}|S|�|�dk}|S)zT
        Try to match a single stored value (dv) with a supplied value (v).
        Fr)rr�_partial_matches�find)rjr�r�r�rr_r_r`r��s��zMatcher.match_valueN)r[r\r]r�r�r�r_r_r_r`rKosrKc
Cs^tdurtStd}z
t�t|�d}Wntttfy%d}Y|a|Swt�|�|a|S)NrLTF)�_can_symlinkr%r��symlinkr��NotImplementedErrorr�r�)�symlink_path�canr_r_r`rL�s�
rLcC� t�}d}|r	|St�|�|�S)z8Skip decorator for tests that require functional symlinkz*Requires functional symlink implementation)rLrjr
�r�okrnr_r_r`rM��rMc	Cs
tdurtSttd�sd}|a|St��\}}zdttd��=}z)t�|dd�t�|��dd�t	�
�}t�d|�}|dupEt
|�d��dk}WntyRd}YnwWd�n1s]wYWtt�t|�|a|SWtt�t|�|a|Stt�t|�w)	N�setxattrFrCs	user.testr�z
2.6.(\d{1,2})r��')�
_can_xattrrr��tempfile�mkstempr	r%r�rDr�r�r}r~r
r6r�r)r��tmp_fp�tmp_name�fp�kernel_versionr.r_r_r`�	can_xattr�s>
����
�
�
r�cCr�)zDSkip decorator for tests that require functional extended attributesz(no non-broken extended attribute support)r�rjr
r�r_r_r`rN�r�rNc	csR�ddl}|jj}d}|�|�}|�||B�zdVW|�|�dS|�|�w)z;Disable Windows Error Reporting dialogs using SetErrorMode.rNr�)r�r��kernel32�SetErrorMode)r��k32�SEM_NOGPFAULTERRORBOX�old_error_moder_r_r`rX�s�
rXccs�dVdSr|r_r_r_r_r`rX�s�
c	spt���d�z�j��Wnttfyt��d��Ynwd�����fdd�}|�|�t��|�dS)z�Override 'object_to_patch'.'attr_name' with 'new_value'.

    Also, add a cleanup procedure to 'test_instance' to restore
    'object_to_patch' value for 'attr_name'.
    The 'attr_name' should be a valid attribute for 'object_to_patch'.

    FNTcs"�r
t����dSt���dSr|)r�r�r_��
attr_is_local�	attr_name�object_to_patch�	old_valuer_r`�cleanup�szpatch.<locals>.cleanup)r�r�r�rx�
addCleanupr�)�
test_instancer�r��	new_valuer�r_r�r`�patch�s

�
r�)T)F)r_r_Fr|)r'FN)r�r_rS)�r^�
__future__rrrr�futurer�future.builtinsrrr	r
rr�
contextlibr�r�r�rrpr�r��shutilrcrjr�	unittest2rhr}rFr�r�rri�	distutilsr|�logging.handlersr�rr�ryr��	threading�thread�multiprocessing.process�multiprocessing�zlib�gzip�bz2�lzma�__all__�	Exceptionrrrkr�contextmanagerrgrrvrzrSrOrFrrrr8rRrzr�rrrrsr�r�r�r�rr�rr�rr��ctypes.wintypesr�rrrrrr r&�HOSTv6rrr!r"r%r#rQ�
SOCK_MAX_SIZE�
skipUnlessrPrVrWr$rlr%r@rAr)r'r(r9r\r)r*r+rFr,r-�objectrfr�r.r/�collections.abc�collections�abc�MutableMapping�mybase�UserDict�	DictMixinr0r�r1r�r�r5r�r�r6r7r:r�r2r4r3r�r�rr
rrrrrrrr8rTr1r2r:�_4GrUr9r;r>r<r=r>r\r]rDr_rarErkrlroryr?r@r�r�rArBr�rCrHrGr�r�r�r�rJrKr�rLrMr�r�rNrXr�r_r_r_r`�<module>s� 
��������


4	
!


		>%}'
	-
,
 
5D
	

$#
-



'#


	"


https://t.me/RX1948 - 2025