Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.145.17.171
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : support.cpython-32.pyo
l
��bcR@sp
dZedkr!ed��nddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZyddlZddlZWnek
rqdZdZYnXyddlZWnek
r�dZYnXddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFgBZ GdG�de!�Z"GdH�de"�Z#GdI�de
j$�Z%ej&d�dJ��Z(d�dK�Z*dL�Z+dM�Z,d�d�d�dN�Z-dO�Z.dPZ/dZ0da1da2d�Z3dZ4da5dQ�Z6dR�Z7dS�Z8ej
j9dT�rtd�dU�Z:dV�Z;dW�Z<dX�Z=ne	j>Z;e	j?Z<ej@Z=dY�Z>dZ�Z?d[�Z@d\�ZAd]�ZBej
j9dT�r�ddlCZCddlDZCd^�ZEn	d_�ZEd`�ZFdda�ZGdb�ZHdcZIejJejKdd�ZLeIde�ZMdfZNdg�ZOe
jPeQjRdh�j9di�dj�ZSej
j9dk�ZTe	jUdkkr�dlZVndmZVdnjWeVe	jX��ZVdZYxDd�D]<ZZye	j[e	j\eZ��Wne]k
r�Yq�XeZZYPq�WeVdzZ^ej
d{krBddl_Z_e_j`d|e^�Z^neja�ZbdZce	jUd�kr�ejd�j
dkreVd�Zcyecjeeb�Wnefk
r�Yq�Xegd�ecebf�dZcqnNej
d{kryd�jheb�Wqeik
reVd�jhebd��ZcYqXndZjxHd�D]@ZUyeUjheb�Wq#eik
rbe	j\eV�eUZjPYq#Xq#WeYr~eVd�eYZkndZke	jl�Zmej&d�d�dd���Znej&d���Zoepdd��Zqd��Zrd��Zsd��Ztd��ZuGd��d�ev�Zwd�d��Zxej&d���ZyGd��d#ev�ZzGd��d$ej{�Z|Gd��d�ev�Z}Gd��d%ev�Z~e~ed�ej��Z�e~ej�d�ej��Z�e~ed�ej��Z�ej&d�d�d�d�d���Z�ej&d���Z�d��Z�d��Z�d��Z�d��Z�d��Z�d�Z�e�ed��r1d�e�Z�ne�d�Z�d��Z�d��Z�d�Z�d�Z�d��Z�d��Z�d��Z�d�Z�d�e�Z�de�Z�d�e�Z�ej�Z�d��Z�d�d��Z�d�d��Z�d��Z�Gd��d3�Z�d��Z�d��Z�d��Z�dd��Z�d��Z�d��Z�d��Z�d��Z�d��Z�e�d�d��pY	ej
d�kpY	ej�d��Z�e
jPe�d��Z�dd��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�ej&d���Z�ej&d���Z�d��Z�d��Z�Gd��d?ej�j��Z�Gd��d@ev�Z�da�d��Z�d��Z�ej
j9dT�rQ
ej&d���Z�nej&d���Z�d��Z�dS(�u7Supporting definitions for the Python regression tests.utest.supportu.support must be imported from the test packageiNuErroru
TestFaileduResourceDeniedu
import_moduleuverboseu
use_resourcesu
max_memuseurecord_original_stdoutuget_original_stdoutuunloaduunlinkurmtreeuforgetuis_resource_enabledurequiresurequires_mac_verufind_unused_portu	bind_portufcmpu	is_jythonuTESTFNuHOSTuFUZZuSAVEDCWDutemp_cwdufindfileusortdictucheck_syntax_erroruopen_urlresourceucheck_warningsuCleanImportuEnvironmentVarGuarduTransientResourceucaptured_outputucaptured_stdoutucaptured_stdinucaptured_stderrutime_outusocket_peer_resetuioerror_peer_reseturun_with_localeu
temp_umaskutransient_internetuset_memlimitu
bigmemtestubigaddrspacetestuBasicTestRunnerurun_unittesturun_doctestuthreading_setuputhreading_cleanupu
reap_childrenucpython_onlyucheck_impl_detailu
get_attributeu	swap_itemu	swap_attrurequires_IEEE_754uTestHandleruMatcherucan_symlinkuskip_unless_symlinkuimport_fresh_moduleufailfasturun_with_tzusuppress_crash_popupcBs|EeZdZdS(u*Base class for regression test exceptions.N(u__name__u
__module__u__doc__(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuError>s
cBs|EeZdZdS(uTest failed.N(u__name__u
__module__u__doc__(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
TestFailedAs
cBs|EeZdZdS(u�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.
    N(u__name__u
__module__u__doc__(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuResourceDeniedDs
ccs=|r4tj��tjddt�dVWdQXndVdS(u�Context manager to suppress package and module deprecation
    warnings when importing them.

    If ignore is False, this context manager has no effect.uignoreu.+ (module|package)N(uwarningsucatch_warningsufilterwarningsuDeprecationWarning(uignore((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_ignore_deprecated_importsLs
cCset|��Sytj|�SWn:tk
rZ}ztjt|���WYdd}~XnXWdQXdS(u�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(u_ignore_deprecated_importsu	importlibu
import_moduleuImportErroruunittestuSkipTestustr(unameu
deprecatedumsg((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
import_module[s

cCs�|tjkr&t|�tj|=nxTttj�D]C}||ks[|j|d�r6tj|||<tj|=q6q6WdS(uwHelper function to save and remove a module from sys.modules

       Raise ImportError if the module can't be imported.u.N(usysumodulesu
__import__ulistu
startswith(unameuorig_modulesumodname((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_save_and_remove_modulehs

cCsGd}ytj|||<Wntk
r5d}YnXdtj|<|S(u�Helper function to save and block a module in sys.modules

       Return True if the module was in sys.modules, False otherwise.TFN(uTrueusysumodulesuKeyErroruFalseuNone(unameuorig_modulesusaved((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_save_and_block_moduleus

cCs�t|���i}g}t||�z�yax|D]}t||�q3Wx-|D]%}t||�sQ|j|�qQqQWtj|�}Wntk
r�d}YnXWdx'|j�D]\}	}
|
t	j
|	<q�Wx|D]}t	j
|=q�WX|SWdQXdS(uImports and returns a module, deliberately bypassing the sys.modules cache
    and importing a fresh copy of the module. Once the import is complete,
    the sys.modules cache is restored to its original state.

    Modules named in fresh are also imported anew if needed by the import.
    If one of these modules can't be imported, None is returned.

    Importing of modules named in blocked is prevented while the fresh import
    takes place.

    If deprecated is True, any module or package deprecation messages
    will be suppressed.N(u_ignore_deprecated_importsu_save_and_remove_moduleu_save_and_block_moduleuappendu	importlibu
import_moduleuImportErroruNoneuitemsusysumodules(unameufreshublockedu
deprecateduorig_modulesunames_to_removeu
fresh_nameublocked_nameufresh_moduleu	orig_nameumoduleuname_to_remove((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuimport_fresh_module�s&





cCsLyt||�}Wn.tk
rCtjd|j|f��YnX|SdS(u?Get an attribute, raising SkipTest if AttributeError is raised.umodule %s has no attribute %sN(ugetattruAttributeErroruunittestuSkipTestu__name__(uobjunameu	attribute((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
get_attribute�s
	icCs
|adS(N(u_original_stdout(ustdout((u3/usr/local/python-3.2/lib/python3.2/test/support.pyurecord_original_stdout�scCs
tptjS(N(u_original_stdoutusysustdout(((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuget_original_stdout�scCs'ytj|=Wntk
r"YnXdS(N(usysumodulesuKeyError(uname((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuunload�s
uwincCs�||�|r|}n$tjj|�\}}|p:d}d}xR|dkr�tj|�}|rm|n	||ks}dStj|�|d9}qFWtjd|tdd�dS(Nu.g����MbP?g�?iu)tests may fail, delete still pending for u
stackleveli(	uosupathusplitulistdirutimeusleepuwarningsuwarnuRuntimeWarning(ufuncupathnameuwaitalludirnameunameutimeoutuL((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_waitfor�s
	

cCsttj|�dS(N(u_waitforuosuunlink(ufilename((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_unlink�scCsttj|�dS(N(u_waitforuosurmdir(udirname((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_rmdir�scs6�fd��t�|dd�ttj|�dS(Ncsuxntj|�D]]}tjj||�}tjj|�r`t�|dd�tj|�qtj|�qWdS(NuwaitallT(	uosulistdirupathujoinuisdiru_waitforuTrueurmdiruunlink(upathunameufullname(u
_rmtree_inner(u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
_rmtree_inner�suwaitallT(u_waitforuTrueuosurmdir(upath((u
_rmtree_inneru3/usr/local/python-3.2/lib/python3.2/test/support.pyu_rmtree�scCs[yt|�WnFtk
rV}z&|jtjtjfkrD�nWYdd}~XnXdS(N(u_unlinkuOSErroruerrnouENOENTuENOTDIR(ufilenameuerror((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuunlinks
cCsRyt|�Wn=tk
rM}z|jtjkr;�nWYdd}~XnXdS(N(u_rmdiruOSErroruerrnouENOENT(udirnameuerror((u3/usr/local/python-3.2/lib/python3.2/test/support.pyurmdirs
cCs[yt|�WnFtk
rV}z&|jtjtjfkrD�nWYdd}~XnXdS(N(u_rmtreeuOSErroruerrnouENOENTuESRCH(upathuerror((u3/usr/local/python-3.2/lib/python3.2/test/support.pyurmtrees
cCsftj|�}tjjtjj|��}tjj||trHdnd�}tj||�|S(ulMove 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.
    ucuo(	uimpucache_from_sourceuosupathudirnameuabspathujoinu	__debug__urename(usourceupyc_fileuup_oneu
legacy_pyc((u3/usr/local/python-3.2/lib/python3.2/test/support.pyumake_legacy_pycs

%cCs�t|�xxtjD]m}tjj||d�}t|d�t|d�ttj|dd��ttj|dd��qWdS(u�'Forget' a module was ever imported.

    This removes the module from sys.modules and deletes any PEP 3147 or
    legacy .pyc and .pyo files.
    u.pyucuoudebug_overrideNTF(
uunloadusysupathuosujoinuunlinkuimpucache_from_sourceuTrueuFalse(umodnameudirnameusource((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuforget+s
cCs�d}d}Gd�dtj�}tjj}|j�}|sOtj��n|�}tjj�}|j||tj	|�tj
|�tj	|��}|s�tj��nt|j|@�S(NicBsA|EeZdejjfdejjfdejjfgZdS(ufInheritu	fReservedudwFlagsN(u__name__u
__module__uctypesuwintypesuBOOLuDWORDu_fields_(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuUSEROBJECTFLAGSCs
uUSEROBJECTFLAGS(
uctypesu	Structureuwindlluuser32uGetProcessWindowStationuWinErroruwintypesuDWORDuGetUserObjectInformationWubyrefusizeofubooludwFlags(u	UOI_FLAGSuWSF_VISIBLEuUSEROBJECTFLAGSudlluhuuofuneededures((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_is_gui_available@s"		cCsdS(NT(uTrue(((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_is_gui_availableVscCstdk	o|tkS(uPTest whether a resource is enabled.  Known resources are set by
    regrtest.py.N(u
use_resourcesuNone(uresource((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuis_resource_enabledYscCs�|dkr(t�r(tjd��ntjd�jjd�dkrMdSt|�s�|dkrrd|}nt	|��ndS(u�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.
    uguiuCannot use the 'gui' resourceiu__name__u__main__Nu$Use of the `%s' resource not enabled(
u_is_gui_availableuunittestuSkipTestusysu	_getframeu	f_globalsugetuis_resource_enableduNoneuResourceDenied(uresourceumsg((u3/usr/local/python-3.2/lib/python3.2/test/support.pyurequires^s!
cs�fd�}|S(u�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.tj����fd��}�|_|S(Ncs�tjdkr�tj�d}y"ttt|jd���}Wntk
rUYq�X|�kr�djtt	���}t
jd||f��q�n�||�S(Nudarwiniu.u&Mac OS X %s or higher required, not %s(usysuplatformumac_verutupleumapuintusplitu
ValueErrorujoinustruunittestuSkipTest(uargsukwuversion_txtuversionumin_version_txt(ufuncumin_version(u3/usr/local/python-3.2/lib/python3.2/test/support.pyuwrapperxs"
(u	functoolsuwrapsumin_version(ufuncuwrapper(umin_version(ufuncu3/usr/local/python-3.2/lib/python3.2/test/support.pyu	decoratorws!	((umin_versionu	decorator((umin_versionu3/usr/local/python-3.2/lib/python3.2/test/support.pyurequires_mac_verpsu	localhostcCs/tj||�}t|�}|j�~|S(u�
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.
    (usocketu	bind_portuclose(ufamilyusocktypeutempsockuport((u3/usr/local/python-3.2/lib/python3.2/test/support.pyufind_unused_port�s
8
cCs�|jtjkr�|jtjkr�ttd�rc|jtjtj�dkrct	d��qcnttd�r�|jtjtj
�dkr�t	d��q�nttd�r�|jtjtjd�q�n|j
|df�|j�d}|S(u%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.
    uSO_REUSEADDRiuHtests should never set the SO_REUSEADDR socket option on TCP/IP sockets!uSO_REUSEPORTuHtests should never set the SO_REUSEPORT socket option on TCP/IP sockets!uSO_EXCLUSIVEADDRUSEi(ufamilyusocketuAF_INETutypeuSOCK_STREAMuhasattru
getsockoptu
SOL_SOCKETuSO_REUSEADDRu
TestFaileduSO_REUSEPORTu
setsockoptuSO_EXCLUSIVEADDRUSEubindugetsockname(usockuhostuport((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu	bind_port�s$g���ư>c
Cs$t|t�st|t�rdy8t|�t|�t}t||�|krUdSWqYqXn�t|�t|�krt|ttf�rxPttt	|�t	|���D]-}t
||||�}|dkr�|Sq�Wt	|�t	|�kt	|�t	|�kS||k||kS(Ni(u
isinstanceufloatuabsuFUZZutypeutupleulisturangeuminulenufcmp(uxuyufuzzuiuoutcome((u3/usr/local/python-3.2/lib/python3.2/test/support.pyufcmp�s-(,udoubleuIEEEutest requires IEEE 754 doublesujavau$testu@testu	{}_{}_tmpuæuİuŁuφuКuאu،uتuกu u€u-àòɘŁğudarwinuNFDuntuceiu-共Ł♡ͣ�utWARNING: The filename %r CAN be encoded by the filesystem encoding (%s). Unicode filename tests may not be effectives�s-�usurrogateescapes�w�s���s�s��u-utempcwdccs�tj�}d}|dkry|}ytj|�d}Wqytk
ru|sW�ntjd|t	dd�YqyXnytj
|�Wn8tk
r�|s��ntjd|t	dd�YnXztj�VWdtj
|�|r�t|�nXdS(u�
    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.
    u*tests may fail, unable to create temp CWD u
stackleveliu,tests may fail, unable to change the CWD to NFT(uosugetcwduFalseuNoneumkdiruTrueuOSErroruwarningsuwarnuRuntimeWarninguchdirurmtree(unameuquietupathu	saved_diruis_temporary((u3/usr/local/python-3.2/lib/python3.2/test/support.pyutemp_cwd�s0







ccs-tj|�}z	dVWdtj|�XdS(u8Context manager that temporarily sets the process umask.N(uosuumask(uumaskuoldmask((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
temp_umask�s	cCs�tjj|�r|S|dk	r:tjj||�}ntj}tjj|�g|}x9|D]1}tjj||�}tjj|�rc|SqcW|S(u�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(uosupathuisabsuNoneujoinusysudirnameuexists(ufileuhereusubdirupathudnufn((u3/usr/local/python-3.2/lib/python3.2/test/support.pyufindfile�s	
cCs9t|j��}d�|D�}dj|�}d|S(u%Like repr(dict), but in sorted order.cSsg|]}d|�qS(u%r: %r((u.0upair((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
<listcomp>�s	u, u{%s}(usorteduitemsujoin(udictuitemsu	reprpairsu
withcommas((u3/usr/local/python-3.2/lib/python3.2/test/support.pyusortdict�scCs9ttd�}z|j�SWd|j�tt�XdS(u`
    Create an invalid file descriptor by opening and closing a file and return
    its fd.
    uwbN(uopenuTESTFNufilenoucloseuunlink(ufile((u3/usr/local/python-3.2/lib/python3.2/test/support.pyumake_bad_fd�s

cCs|jtt|dd�dS(Nu
<test string>uexec(uassertRaisesuSyntaxErrorucompile(utestcaseu	statement((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucheck_syntax_error�sc
s�ddl}ddl}�jdd��|jj|�djd�d}tjj	tjj
t�d|�}���fd�}tjj|�r�||�}|dk	r�|St
|�ntd�td	|d
t��|jj|dd�}zNt|d
��9}|j�}	x#|	r@|j|	�|j�}	qWWdQXWd|j�X||�}|dk	rr|Std|��dS(Niucheckiu/iudatacsMt|���}�dkr"|S�|�r?|jd�|S|j�dS(Ni(uopenuNoneuseekuclose(ufnuf(uargsucheckukw(u3/usr/local/python-3.2/lib/python3.2/test/support.pyucheck_valid_file�s
uurlfetchu	fetching %s ...ufileutimeoutiuwbuinvalid resource "%s"i����(uurllib.requestuurllib.parseupopuNoneuparseuurlparseusplituosupathujoinudirnameu__file__uexistsuunlinkurequiresuprintuget_original_stdouturequestuurlopenuopenureaduwriteucloseu
TestFailed(
uurluargsukwuurllibufilenameufnucheck_valid_fileufuoutus((uargsucheckukwu3/usr/local/python-3.2/lib/python3.2/test/support.pyuopen_urlresource�s0#$	

	
cBs>|EeZdZd�Zd�Zed��Zd�ZdS(uyConvenience wrapper for the warnings list returned on
       entry to the warnings.catch_warnings() context manager.
    cCs||_d|_dS(Ni(u	_warningsu_last(uselfu
warnings_list((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__init__s	cCs\t|j�|jkr,t|jd|�S|tjjkrBdStd||f��dS(Niu%r has no attribute %ri����(	ulenu	_warningsu_lastugetattruwarningsuWarningMessageu_WARNING_DETAILSuNoneuAttributeError(uselfuattr((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__getattr__s
cCs|j|jd�S(N(u	_warningsu_last(uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuwarningsscCst|j�|_dS(N(ulenu	_warningsu_last(uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyureset"sN(u__name__u
__module__u__doc__u__init__u__getattr__upropertyuwarningsureset(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuWarningsRecorders

		uWarningsRecorderccsltjd�}|jjd�}|r4|j�ntjdd
��&}tjdj	d�t
|�VWdQXt|�}g}x�|D]�\}}d}	xg|dd�D]U}|j
}
tj|t|
�tj�r�t|
j|�r�d
}	|j|�q�q�W|	r�|r�|j||jf�q�q�W|rKtd|d��n|rhtd	|d��ndS(u�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.
    iu__warningregistry__urecorduwarningsualwaysNuunhandled warning %siu)filter (%r, %s) did not catch any warningTF(usysu	_getframeu	f_globalsugetuclearuwarningsucatch_warningsuTrueumodulesusimplefilteruWarningsRecorderulistuFalseumessageureumatchustruIu
issubclassu	__class__uremoveuappendu__name__uAssertionError(ufiltersuquietuframeuregistryuwureraiseumissingumsgucatuseenuwarning((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_filterwarnings&s0
	cOsI|jd�}|s<dtff}|dkr<d}q<nt||�S(u�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)
    uquietuNT(ugetuWarninguNoneuTrueu_filterwarnings(ufiltersukwargsuquiet((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucheck_warningsMscBs/|EeZdZd�Zd�Zd�ZdS(u,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
    cGsotjj�|_xV|D]N}|tjkrtj|}|j|krZtj|j=ntj|=qqWdS(N(usysumodulesucopyuoriginal_modulesu__name__(uselfumodule_namesumodule_nameumodule((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__init__qs

cCs|S(N((uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu	__enter__~scGstjj|j�dS(N(usysumodulesuupdateuoriginal_modules(uselfu
ignore_exc((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__exit__�sN(u__name__u
__module__u__doc__u__init__u	__enter__u__exit__(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuCleanImportes

	
	cBsw|EeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
dS(
u_Class to help protect the environment variable properly.  Can be used as
    a context manager.cCstj|_i|_dS(N(uosuenvironu_environu_changed(uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__init__�scCs|j|S(N(u_environ(uselfuenvvar((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__getitem__�scCs<||jkr+|jj|�|j|<n||j|<dS(N(u_changedu_environuget(uselfuenvvaruvalue((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__setitem__�scCsK||jkr+|jj|�|j|<n||jkrG|j|=ndS(N(u_changedu_environuget(uselfuenvvar((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__delitem__�scCs
|jj�S(N(u_environukeys(uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyukeys�scCs
t|j�S(N(uiteru_environ(uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__iter__�scCs
t|j�S(N(ulenu_environ(uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__len__�scCs|||<dS(N((uselfuenvvaruvalue((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuset�scCs||=dS(N((uselfuenvvar((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuunset�scCs|S(N((uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu	__enter__�scGshxU|jj�D]D\}}|dkrG||jkrT|j|=qTq||j|<qW|jt_dS(N(u_changeduitemsuNoneu_environuosuenviron(uselfu
ignore_excukuv((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__exit__�sN(u__name__u
__module__u__doc__u__init__u__getitem__u__setitem__u__delitem__ukeysu__iter__u__len__usetuunsetu	__enter__u__exit__(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuEnvironmentVarGuard�s
										cBs/|EeZdZd�Zd�Zd�ZdS(u�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.
    cGs6tjdd�|_tj|_tjj|�dS(N(usysupathuoriginal_valueuoriginal_objectuextend(uselfupaths((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__init__�scCs|S(N((uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu	__enter__�scGs&|jt_|jtjdd�<dS(N(uoriginal_objectusysupathuoriginal_value(uselfu
ignore_exc((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__exit__�sN(u__name__u
__module__u__doc__u__init__u	__enter__u__exit__(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
DirsOnSysPath�s

		u
DirsOnSysPathcBs8|EeZdZd�Zd�Zdddd�ZdS(u�Raise ResourceDenied if an exception is raised while the context manager
    is in effect that matches the specified exception and attributes.cKs||_||_dS(N(uexcuattrs(uselfuexcukwargs((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__init__�s	cCs|S(N((uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu	__enter__�scCs}|dk	ryt|j|�ryxX|jj�D]8\}}t||�sMPnt||�|kr.Pq.q.Wtd��ndS(u�If type_ is a subclass of self.exc and value has attributes matching
        self.attrs, raise ResourceDenied.  Otherwise let the exception
        propagate (if any).u%an optional resource is not availableN(uNoneu
issubclassuexcuattrsuitemsuhasattrugetattruResourceDenied(uselfutype_uvalueu	tracebackuattru
attr_value((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__exit__�sN(u__name__u
__module__u__doc__u__init__u	__enter__uNoneu__exit__(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuTransientResource�s
		uerrnoutimeoutg>@uerrnosc	#s�ddddd g}dd!fd
d"fdd#fdd$fd%g}td|��|�g��s�d�|D��d�|D��n���fd�}tj�}z�y%|dk	r�tj|�ndVWn�tk
rx}z�xq|j}t|�dkr#t|dt�r#|d}q�t|�dkrUt|dt�rU|d}q�Pq�||��WYdd}~XnXWdtj|�XdS(&u�Return a context manager that raises ResourceDenied when various issues
    with the Internet connection manifest themselves as exceptions.uECONNREFUSEDiou
ECONNRESETihuEHOSTUNREACHiquENETUNREACHieu	ETIMEDOUTinu	EAI_AGAINiuEAI_FAILiu
EAI_NONAMEiu
EAI_NODATAiu
WSANO_DATAi�*uResource '%s' is not availablecSs(g|]\}}tt||��qS((ugetattruerrno(u.0unameunum((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
<listcomp>s	cSs(g|]\}}tt||��qS((ugetattrusocket(u.0unameunum((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
<listcomp>s	cs�t|dd�}t|tj�sNt|tj�rB|�ksN|�kr~tsrtjj	�j
dd�n�|�ndS(Nuerrnoiu
(ugetattruNoneu
isinstanceusocketutimeoutugaierroruverboseusysustderruwriteuargs(uerrun(ucaptured_errnosudeniedu
gai_errnos(u3/usr/local/python-3.2/lib/python3.2/test/support.pyufilter_errorsNii(uECONNREFUSEDio(u
ECONNRESETih(uEHOSTUNREACHiq(uENETUNREACHie(u	ETIMEDOUTini����i����i����i����(u
WSANO_DATAi�*(	uResourceDeniedusocketugetdefaulttimeoutuNoneusetdefaulttimeoutuIOErroruargsulenu
isinstance(	u
resource_nameutimeoutuerrnosudefault_errnosudefault_gai_errnosufilter_erroruold_timeoutuerrua((ucaptured_errnosudeniedu
gai_errnosu3/usr/local/python-3.2/lib/python3.2/test/support.pyutransient_internet�sH						

			%
%

c
cs[ddl}tt|�}tt||j��ztt|�VWdtt||�XdS(u�Return a context manager used by captured_stdout/stdin/stderr
    that temporarily replaces the sys stream *stream_name* with a StringIO.iN(uiougetattrusysusetattruStringIO(ustream_nameuiouorig_stdout((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucaptured_output5scCs
td�S(u�Capture the output of sys.stdout:

       with captured_stdout() as s:
           print("hello")
       self.assertEqual(s.getvalue(), "hello")
    ustdout(ucaptured_output(((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucaptured_stdoutAscCs
td�S(Nustderr(ucaptured_output(((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucaptured_stderrJscCs
td�S(Nustdin(ucaptured_output(((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucaptured_stdinMscCs8tj�tr tjd�ntj�tj�dS(u�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.
    g�������?N(ugcucollectu	is_jythonutimeusleep(((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
gc_collectQs



cCsZtjd�pd}d}x,|j�D]}|jd�r(|}q(q(W|oY|dkS(u,Find if Python was built with optimizations.u	PY_CFLAGSuu-Ou-O0(u	sysconfiguget_config_varusplitu
startswith(ucflagsu	final_optuopt((u3/usr/local/python-3.2/lib/python3.2/test/support.pyupython_is_optimizedbs
u2PugettotalrefcountuPcCstjt|d�S(Nu0P(ustructucalcsizeu_header(ufmt((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucalcobjsizeqscCstjt|d�S(Nu0P(ustructucalcsizeu_vheader(ufmt((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucalcvobjsizetsii	cCs�tj|�}t|�tkr.|jt@sSt|�tkrct|�jt@rc|tj7}ndt|�||f}|j|||�dS(Nu&wrong size for %s: got %d, expected %d(	usysu	getsizeofutypeu	__flags__u_TPFLAGS_HEAPTYPEu_TPFLAGS_HAVE_GCu	_testcapiuSIZEOF_PYGC_HEADuassertEqual(utestuousizeuresultumsg((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucheck_sizeof{s%cs��fd�}|S(Ncs1���fd�}�j|_�j|_|S(Ncs�y.ddl}t|��}|j|�}Wn&tk
rE�YnCd}}Yn2Xx.�D]&}y|j||�PWq^Yq^Xq^Wz�||�SWd|r�|r�|j||�nXdS(Ni(ulocaleugetattru	setlocaleuAttributeErroruNone(uargsukwdsulocaleucategoryuorig_localeuloc(ucatstrufunculocales(u3/usr/local/python-3.2/lib/python3.2/test/support.pyuinner�s$

	(u__name__u__doc__(ufuncuinner(ucatstrulocales(ufuncu3/usr/local/python-3.2/lib/python3.2/test/support.pyu	decorator�s((ucatstrulocalesu	decorator((ucatstrulocalesu3/usr/local/python-3.2/lib/python3.2/test/support.pyurun_with_locale�scs�fd�}|S(Ncs.��fd�}�j|_�j|_|S(Ncs�y
tj}Wn!tk
r0tjd��YnXdtjkrPtjd}nd}�tjd<|�z�||�SWd|dkr�tjd=n
|tjd<tj�XdS(Nutzset requireduTZ(utimeutzsetuAttributeErroruunittestuSkipTestuosuenvironuNone(uargsukwdsutzsetuorig_tz(ufuncutz(u3/usr/local/python-3.2/lib/python3.2/test/support.pyuinner�s




(u__name__u__doc__(ufuncuinner(utz(ufuncu3/usr/local/python-3.2/lib/python3.2/test/support.pyu	decorator�s((utzu	decorator((utzu3/usr/local/python-3.2/lib/python3.2/test/support.pyurun_with_tz�siicCs�idd6td6td6dtd6}tjd|tjtjB�}|dkrgtd|f��ntt	|j
d��||j
d	�j��}|a|t
kr�t
}n|tdkr�td
|f��n|adS(Niukumugutu(\d+(\.\d+)?) (K|M|G|T)b?$uInvalid memory limit %riiu$Memory limit %r too low to be useful(u_1Mu_1Gureumatchu
IGNORECASEuVERBOSEuNoneu
ValueErroruintufloatugroupulowerureal_max_memuseuMAX_Py_ssize_tu_2Gu
max_memuse(ulimitusizesumumemlimit((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuset_memlimit�s 2	g$@c
)Cs�ytjd�}WnLttfk
raytjd�}Wnttfk
r\d}YnXYnXdjdtj��}yt|d�}WnOtk
r�}z/tj	dj|�t
�tjj
�dSWYdd}~XnX|��|j�d}x~|j|�sv|jd
�|j�jd�}t|j�d�}	|	|kr�|	}td
jd|	|d��q�q�WWdQXdS(uaA function which periodically watches the process' memory consumption
    and prints it out.
    uSC_PAGESIZEuSC_PAGE_SIZEiu/proc/{pid}/statmupidurbu!/proc not available for stats: {}Niiuasciiiu# ... process data size: {data:.1f}Gudataiii����i@(uosusysconfu
ValueErroruAttributeErroruformatugetpiduopenuIOErroruwarningsuwarnuRuntimeWarningusysustderruflushusetuwaituseekureadudecodeuintusplituprint(
u	start_evtu
finish_evtuperiodu	page_sizeuprocfileufueuold_dataustatmudata((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_memory_watchdog�s4	


cs���fd�}|S(uADecorator 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+���fd����_��_�S(Ncs;�j}�j}ts!d}n|}ts4�rbt||krbtjd||d
��ntr�tr�tr�t�tdjd||d��t	j
j�tj�}tj�}tj
dtd||d	f�}d|_|j�|j�nd}z�||�SWd|r6|j�|j�nXdS(
Niu'not enough memory: %.1fG minimum needediiu* ... expected peak memory use: {peak:.1f}Gupeakutargetuargsg�?i@i@T(usizeumemuseureal_max_memuseuunittestuSkipTestuverboseu	threadinguprintuformatusysustdoutuflushuEventuThreadu_memory_watchdoguTrueudaemonustartusetuNoneujoin(uselfusizeumemuseumaxsizeu	start_evtu
finish_evtut(udry_runufuwrapper(u3/usr/local/python-3.2/lib/python3.2/test/support.pyuwrappers8			

	


(usizeumemuse(uf(udry_runumemuseusize(ufuwrapperu3/usr/local/python-3.2/lib/python3.2/test/support.pyu	decorators$		((usizeumemuseudry_runu	decorator((udry_runumemuseusizeu3/usr/local/python-3.2/lib/python3.2/test/support.pyu
bigmemtests
(cs�fd�}|S(u0Decorator for tests that fill the address space.cs^ttkrPtd
kr6tdkr6tjd��qZtjdtd��n
�|�SdS(
Nii?iiu-not enough memory: try a 32-bit build insteadu'not enough memory: %.1fG minimum needediilI�������I�i@(u
max_memuseuMAX_Py_ssize_tuunittestuSkipTest(uself(uf(u3/usr/local/python-3.2/lib/python3.2/test/support.pyuwrapperFs((ufuwrapper((ufu3/usr/local/python-3.2/lib/python3.2/test/support.pyubigaddrspacetestDscBs|EeZd�ZdS(cCstj�}||�|S(N(uunittestu
TestResult(uselfutesturesult((u3/usr/local/python-3.2/lib/python3.2/test/support.pyurunWs
N(u__name__u
__module__urun(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuBasicTestRunnerVs
cCs|S(N((uobj((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu_id\scCsM|dkr#t�r#tjd�St|�r3tStjdj|��SdS(Nuguiuresource 'gui' is not availableuresource {0!r} is not enabled(u_is_gui_availableuunittestuskipuis_resource_enabledu_iduformat(uresource((u3/usr/local/python-3.2/lib/python3.2/test/support.pyurequires_resource_s

cCstdd�|�S(u9
    Decorator for tests only applicable on CPython.
    ucpythonT(uimpl_detailuTrue(utest((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucpython_onlygscKs}t|�rtS|dkrpt|�\}}|r=d}nd}t|j��}|jdj|��}ntj	|�S(Nu*implementation detail not available on {0}u%implementation detail specific to {0}u or (
ucheck_impl_detailu_iduNoneu
_parse_guardsusortedukeysuformatujoinuunittestuskip(umsguguardsu
guardnamesudefault((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuimpl_detailms	cCs8|sidd6dfSt|j��d}||fS(NucpythoniTF(uTrueuFalseulistuvalues(uguardsuis_true((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
_parse_guardszscKs.t|�\}}|jtj�j�|�S(u5This 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
    (u
_parse_guardsugetuplatformupython_implementationulower(uguardsudefault((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucheck_impl_detail�scCsrg}x\|jD]Q}t|tj�rEt||�|j|�q||�r|j|�qqW||_dS(u>Recursively filter test cases in a suite based on a predicate.N(u_testsu
isinstanceuunittestu	TestSuiteu
_filter_suiteuappend(usuiteupredunewtestsutest((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
_filter_suite�s
cCs�tr'tjtjdddt�}n	t�}|j|�}|j�s�t	|j
�dkr~|jr~|j
dd}nLt	|j�dkr�|j
r�|jdd}nd}ts�|d7}nt|��ndS(	u2Run tests from a unittest.TestSuite-derived class.u	verbosityiufailfastiiumultiple errors occurredu!; run in verbose mode for detailsN(
uverboseuunittestuTextTestRunnerusysustdoutufailfastuBasicTestRunnerurunu
wasSuccessfululenuerrorsufailuresu
TestFailed(usuiteurunneruresultuerr((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
_run_suite�s	
cGs�tjtjf}tj�}x�|D]�}t|t�rx|tjkri|jtjtj|��q�t	d��q%t||�r�|j|�q%|jtj
|��q%Wd�}t||�t|�dS(u1Run tests from unittest.TestCase-derived classes.u)str arguments must be keys in sys.modulescSsJtdkrdSx3|j�jd�D]}tj|t�r&dSq&WdS(Nu.TF(umatch_testsuNoneuTrueuidusplitufnmatchufnmatchcaseuFalse(utestuname((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu	case_pred�sN(
uunittestu	TestSuiteuTestCaseu
isinstanceustrusysumodulesuaddTestu
findTestCasesu
ValueErroru	makeSuiteu
_filter_suiteu
_run_suite(uclassesuvalid_typesusuiteuclsu	case_pred((u3/usr/local/python-3.2/lib/python3.2/test/support.pyurun_unittest�s
 	
ucpythonuwin32uWITH_DOC_STRINGSutest requires docstringscCs�ddl}|dkr!t}nd}|j|d|�\}}|ratd||f��ntr�td|j|f�n||fS(uRun 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).
    iNuverboseu%d of %d doctests failedu,doctest (%s) ... %d tests with zero failures(udoctestuNoneuverboseutestmodu
TestFaileduprintu__name__(umoduleu	verbosityudoctestufut((u3/usr/local/python-3.2/lib/python3.2/test/support.pyurun_doctest�s	cCstjj�fS(N(usysumodulesucopy(((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
modules_setup�scCsJd�tjj�D�}tjj�tjj|�tjj|�dS(NcSs1g|]'\}}|jd�r||f�qS(u
encodings.(u
startswith(u.0ukuv((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
<listcomp>�s		(usysumodulesuitemsuclearuupdate(u
oldmodulesu	encodings((u3/usr/local/python-3.2/lib/python3.2/test/support.pyumodules_cleanup�s
cCs-trtj�tjj�fSddfSdS(Ni((u_threadu_countu	threadingu	_danglingucopy(((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuthreading_setupscGsdts
dSd}xMt|�D]?}tj�tjf}||krHPntjd�t�qWdS(Ni
g�������?(u_threadurangeu_countu	threadingu	_danglingutimeusleepu
gc_collect(uoriginal_valuesu
_MAX_COUNTucountuvalues((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuthreading_cleanups
cs,ts
�Stj���fd��}|S(u�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�|�SWdt|�XdS(N(uthreading_setuputhreading_cleanup(uargsukey(ufunc(u3/usr/local/python-3.2/lib/python3.2/test/support.pyu	decorator)s	(u_threadu	functoolsuwraps(ufuncu	decorator((ufuncu3/usr/local/python-3.2/lib/python3.2/test/support.pyureap_threads!sc	Cs]ttd�rYd}xAy/tj|tj�\}}|dkrFPnWqPYqXqndS(u�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.
    uwaitpidiiNi����(uhasattruosuwaitpiduWNOHANG(uany_processupidustatus((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu
reap_children2s	c
cs|t||�rNt||�}t|||�z	dVWdt|||�Xn*t|||�z	dVWdt||�XdS(umTemporary 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(uhasattrugetattrusetattrudelattr(uobjuattrunew_valureal_val((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu	swap_attrFs
		ccs\||kr:||}|||<z	dVWd|||<Xn|||<z	dVWd||=XdS(ukTemporary 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.
    N((uobjuitemunew_valureal_val((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu	swap_itemas


	
	cCstjdd|�j�}|S(u�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?$s(ureusubustrip(ustderr((u3/usr/local/python-3.2/lib/python3.2/test/support.pyustrip_python_stderr|scCs�idd6dd6dd6dd6d	d
6dd6d
d6dd6}g}xP|j�D]B\}}ttj|�}|dkrQ|jd||�qQqQW|S(uZReturn a list of command-line arguments reproducing the current
    settings in sys.flags.ubu
bytes_warninguBudont_write_bytecodeuRuhash_randomizationuEuignore_environmentusuno_user_siteuSuno_siteuOuoptimizeuvuverboseiu-(uitemsugetattrusysuflagsuappend(uflag_opt_mapuargsuflaguoptuv((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuargs_from_interpreter_flags�s
cBs2|EeZd�Zd�Zd�Zd�ZdS(cCs#tjjj|d�||_dS(Ni(ulogginguhandlersuBufferingHandleru__init__umatcher(uselfumatcher((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu__init__�scCsdS(NF(uFalse(uself((u3/usr/local/python-3.2/lib/python3.2/test/support.pyushouldFlush�scCs$|j|�|jj|j�dS(N(uformatubufferuappendu__dict__(uselfurecord((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuemit�s
cKs=d}x0|jD]%}|jj||�rd}PqqW|S(uW
        Look for a saved dict whose keys/values match the supplied arguments.
        FT(uFalseubufferumatcherumatchesuTrue(uselfukwargsuresultud((u3/usr/local/python-3.2/lib/python3.2/test/support.pyumatches�sN(u__name__u
__module__u__init__ushouldFlushuemitumatches(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuTestHandler�s
				cBs&|EeZdZd�Zd�ZdS(umsgumessagecKsSd}xF|D]>}||}|j|�}|j|||�s
d}Pq
q
W|S(u.
        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(uTrueugetumatch_valueuFalse(uselfudukwargsuresultukuvudv((u3/usr/local/python-3.2/lib/python3.2/test/support.pyumatches�s

cCsjt|�t|�kr!d}nEt|�tk	sB||jkrQ||k}n|j|�dk}|S(uT
        Try to match a single stored value (dv) with a supplied value (v).
        iF(utypeuFalseustru_partial_matchesufind(uselfukudvuvuresult((u3/usr/local/python-3.2/lib/python3.2/test/support.pyumatch_value�s	!N(umsgumessage(u__name__u
__module__u_partial_matchesumatchesumatch_value(u
__locals__((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuMatcher�s
	c
Csotdk	rtStd}ytjt|�d}Wn!tttfk
rWd}YnXtj
|�|a|S(Nucan_symlinkTF(u_can_symlinkuNoneuTESTFNuosusymlinkuTrueuOSErroruNotImplementedErroruAttributeErroruFalseuremove(usymlink_pathucan((u3/usr/local/python-3.2/lib/python3.2/test/support.pyucan_symlink�s


cCs,t�}d}|r|Stj|�|�S(u8Skip decorator for tests that require functional symlinku*Requires functional symlink implementation(ucan_symlinkuunittestuskip(utestuokumsg((u3/usr/local/python-3.2/lib/python3.2/test/support.pyuskip_unless_symlink�s	ccs\ddl}|jj}d}|j|�}|j||B�z	dVWd|j|�XdS(u;Disable Windows Error Reporting dialogs using SetErrorMode.iNi(uctypesuwindllukernel32uSetErrorMode(uctypesuk32uSEM_NOGPFAULTERRORBOXuold_error_mode((u3/usr/local/python-3.2/lib/python3.2/test/support.pyusuppress_crash_popup�s	ccs	dVdS(N((((u3/usr/local/python-3.2/lib/python3.2/test/support.pyusuppress_crash_popupscs�t���d�y�j��Wn*ttfk
rPt��d��YnXd�����fd�}|j|�t��|�dS(u�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'.

    cs*�rt����n
t���dS(N(usetattrudelattr((u
attr_is_localu	attr_nameuobject_to_patchu	old_value(u3/usr/local/python-3.2/lib/python3.2/test/support.pyucleanup sNFT(	ugetattruFalseu__dict__uAttributeErroruKeyErroruNoneuTrueu
addCleanupusetattr(u
test_instanceuobject_to_patchu	attr_nameu	new_valueucleanup((u
attr_is_localu	attr_nameuobject_to_patchu	old_valueu3/usr/local/python-3.2/lib/python3.2/test/support.pyupatch
s


TF(((uæuİuŁuφuКuאu،uتuกu u€(untuce(s�w�s�s���s�s��(i@ii(�u__doc__u__name__uImportErroru
contextlibuerrnou	functoolsugcusocketusysuosuplatformushutiluwarningsuunittestu	importlibucollectionsureu
subprocessuimputimeu	sysconfigufnmatchulogging.handlersuloggingustructutempfileu	_testcapiu_threadu	threadinguNoneumultiprocessing.processumultiprocessingu__all__u	ExceptionuErroru
TestFaileduSkipTestuResourceDenieducontextmanageruTrueu_ignore_deprecated_importsuFalseu
import_moduleu_save_and_remove_moduleu_save_and_block_moduleuimport_fresh_moduleu
get_attributeuverboseu
use_resourcesu
max_memuseureal_max_memuseufailfastumatch_testsu_original_stdouturecord_original_stdoutuget_original_stdoutuunloadu
startswithu_waitforu_unlinku_rmdiru_rmtreeuunlinkurmdirurmtreeumake_legacy_pycuforgetuctypesuctypes.wintypesu_is_gui_availableuis_resource_enabledurequiresurequires_mac_veruHOSTuAF_INETuSOCK_STREAMufind_unused_portu	bind_portuFUZZufcmpu
skipUnlessufloatu
__getformat__urequires_IEEE_754u	is_jythonunameuTESTFNuformatugetpiduFS_NONASCIIu	characterufsdecodeufsencodeuUnicodeErroruTESTFN_UNICODEuunicodedatau	normalizeugetfilesystemencodinguTESTFN_ENCODINGuTESTFN_UNENCODABLEugetwindowsversionuencodeuUnicodeEncodeErroruprintudecodeuUnicodeDecodeErroruTESTFN_UNDECODABLEuTESTFN_NONASCIIugetcwduSAVEDCWDutemp_cwdu
temp_umasku__file__ufindfileusortdictumake_bad_fducheck_syntax_erroruopen_urlresourceuobjectuWarningsRecorderu_filterwarningsucheck_warningsuCleanImportuMutableMappinguEnvironmentVarGuardu
DirsOnSysPathuTransientResourceuIOErroru	ETIMEDOUTutime_outuerroru
ECONNRESETusocket_peer_resetuioerror_peer_resetutransient_internetucaptured_outputucaptured_stdoutucaptured_stderrucaptured_stdinu
gc_collectupython_is_optimizedu_headeruhasattru_vheaderucalcobjsizeucalcvobjsizeu_TPFLAGS_HAVE_GCu_TPFLAGS_HEAPTYPEucheck_sizeofurun_with_localeurun_with_tzu_1Mu_1Gu_2Gu_4GumaxsizeuMAX_Py_ssize_tuset_memlimitu_memory_watchdogu
bigmemtestubigaddrspacetestuBasicTestRunneru_idurequires_resourceucpython_onlyuimpl_detailu
_parse_guardsucheck_impl_detailu
_filter_suiteu
_run_suiteurun_unittestuget_config_varuHAVE_DOCSTRINGSurequires_docstringsurun_doctestu
modules_setupumodules_cleanuputhreading_setuputhreading_cleanupureap_threadsu
reap_childrenu	swap_attru	swap_itemustrip_python_stderruargs_from_interpreter_flagsuhandlersuBufferingHandleruTestHandleruMatcheru_can_symlinkucan_symlinkuskip_unless_symlinkusuppress_crash_popupupatch(((u3/usr/local/python-3.2/lib/python3.2/test/support.pyu<module>s�

						
	
	
&	
			!													>			








'
				,' 5	@						


				$	#


		$4				
	
		
											
	"		
© 2025 GrazzMean