asda?‰PNG  IHDR ? f ??C1 sRGB ??é gAMA ±? üa pHYs ? ??o¨d GIDATx^íüL”÷e÷Y?a?("Bh?_ò???¢§?q5k?*:t0A-o??¥]VkJ¢M??f?±8\k2íll£1]q?ù???T a bYh!@sddlmZddlmZmZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZdaGdddejZGdddejZGdd d ejZejjGd d d ejZejjGd d d ejZedkr edS))support)assert_python_okassert_python_failureNc@s$eZdZddZddZddZdS)DisplayHookTestcCstj}t}|dWdn1s,0Y||d|tjdt`t}|dWdn1s~0Y||d|t td | t |tj }zt` | t |dW|t_ n|t_ 0dS)N*z42 _)sys__displayhook__rZcaptured_stdout assertEqualgetvaluebuiltinsr assertTruehasattr assertRaises TypeErrorstdout RuntimeError)selfZdhoutrr)/usr/local/lib/python3.9/test/test_sys.pytest_original_displayhooks  & & z)DisplayHookTest.test_original_displayhookcCs<tj}z(t`tddd}|tt|W|t_n|t_0dS)N42single)r displayhookcompilerreval)rrcoderrrtest_lost_displayhook5s  z%DisplayHookTest.test_lost_displayhookcCsTdd}ttd|*tddd}|tt|Wdn1sF0YdS)NcSstdSN ValueError)objrrrbaddisplayhook?sz?DisplayHookTest.test_custom_displayhook..baddisplayhookrrrr)r swap_attrr rrr#r)rr%rrrrtest_custom_displayhook>s z'DisplayHookTest.test_custom_displayhookN)__name__ __module__ __qualname__rr r'rrrrrs rc@s$eZdZddZddZddZdS)ExceptHookTestc Csz tdWnZtyf}zBt}tjtWdn1sH0YWYd}~n d}~00||d| t tjdS)NrValueError: 42 ) r#rcaptured_stderrr __excepthook__exc_inforr endswithrrrexcerrrrrtest_original_excepthookIs  Bz'ExceptHookTest.test_original_excepthookc CsttdtztddWnZty~}zBt}tjt Wdn1s`0YWYd}~n d}~00Wdn1s0Y| }| d|| d|| | ddS)Nignoremsg)sbytes_filename{rtextz% File "b'bytes_filename'", line 123 z text zSyntaxError: msg )warningscatch_warnings simplefilter BytesWarning SyntaxErrorrr-r r.r/r assertInrr0r1rrrtest_excepthook_bytes_filenameTs   `  z-ExceptHookTest.test_excepthook_bytes_filenamecCsPtjd}tdddWdn1s00Y|d|vdS)Nstderr1zETypeError: print_exception(): Exception expected for value, str found)testrcaptured_outputr excepthookrr )rr@rrrtest_excepthookes ,zExceptHookTest.test_excepthookN)r(r)r*r4r?rFrrrrr+Gs r+c@seZdZddZddZddZddZd d Zd d Ze j j d dZ ddZ ddZeeeddddZe j jddZddZe j jddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Z d-d.Z!e j j d/d0Z"d1d2Z#ee j j$d3ee%e&'d4kd5d6d7Z(e)ej*ej+kd8d9d:Z,dbdd?Z.dcd@dAZ/dBdCZ0dDdEZ1dFdGZ2dHdIZ3e j j dJdKZ4eeedLdMdNdOZ5dPdQZ6dRdSZ7dTdUZ8eeedVdWdXdYZ9dZd[Z:d\d]Z;eeed^d_d`daZ.check_exit_messagez?import sys; sys.stderr.write("unflushed,"); sys.exit("message")sunflushed,messagez)import sys; sys.exit("surrogates:\uDCFF")ssurrogates:\udcffzimport sys; sys.exit("h\xe9")shzlatin-1)PYTHONIOENCODING) rrr rM SystemExit assertIsNone exceptionrrr r)rcmrTrr3rUrrIr test_exittsJ &    ( ( * *    zSysModuleTest.test_exitcCs$|ttjd|ttdS)Nr)rrr getdefaultencodingassertIsInstancestrrIrrrtest_getdefaultencodingsz%SysModuleTest.test_getdefaultencodingc Cs|ttj|ttjd|ttjd|ttjdt}||dk|z:ddd|fD]}t||t|qdWt|n t|0dS)Naggg?gh㈵>g?g@)rrr setswitchintervalr#getswitchintervalrZassertAlmostEqual)rZorignrrrtest_switchintervals z!SysModuleTest.test_switchintervalcCs^|ttjdt}|ttj|ttjdtd|tdt|dS)Nrii')rrr getrecursionlimitsetrecursionlimitr#r )roldlimitrrrtest_recursionlimits z!SysModuleTest.test_recursionlimitc sttdrtr|dt}fddzVdD]B}zt|Wnty^Yq6Yn0|t|tq6Wt|n t|0dS)Ngettracez(fatal error if run with a trace functioncs dSr!rrfrrrksz5SysModuleTest.test_recursionlimit_recovery..f) 2Kd)rr riZskipTestrerfRecursionErrorr)rrgdepthrrjrtest_recursionlimit_recoverys     z*SysModuleTest.test_recursionlimit_recoveryc sbddlmfddt}z,tddD]}||q4Wt|n t|0dS)Nr)get_recursion_depthcsd}||krVt}t|Wdn1s80Yt|jdn ||dS)Nz\cannot set the recursion limit to [0-9]+ at the recursion depth [0-9]+: the limit is too low)rrsr rfZ assertRegexr^rY)rtlimitrecursion_depthrZrvrset_recursion_limit_at_depthrrrzs ( zZSysModuleTest.test_setrecursionlimit_recursion_depth..set_recursion_limit_at_depthrr)rlrmrnrorp)_testinternalcapirvr rerf)rrgrwrryr&test_setrecursionlimit_recursion_depths   z4SysModuleTest.test_setrecursionlimit_recursion_depthcCsvtjtdt}|t|d||dt||dt||dt||dt||dt | t t j |d||jt||jt||jt||jt||jt ||jt||jt||jt||jt||d|j||d|j||d|j||d|j||d|jt\}}}}}dS)NgetwindowsversionrrA)rCr get_attributer rr lenr]intr^r IndexErroroperatorgetitemmajorminorZbuildplatformZ service_packZservice_pack_minorZservice_pack_majorZ suite_maskZ product_type)rvZmajminZbuildnoZplatZcsdrrrtest_getwindowsversion s0z$SysModuleTest.test_getwindowsversioncCs|ttjtddS)Nr)rrr call_tracingtyperIrrrtest_call_tracing)szSysModuleTest.test_call_tracingsetdlopenflagsztest needs sys.setdlopenflags()cCsf|ttd|ttjdt}|ttjt|d|t|dt|dS)NgetdlopenflagsrrA)rrr rrrrr )rZoldflagsrrrtest_dlopenflags,szSysModuleTest.test_dlopenflagscCsd|ttjtd}da|td|db|td|ttdr`|tt dS)NrAgettotalrefcount) rrr getrefcountrcr rr]rr)rcrrr test_refcount7s  zSysModuleTest.test_refcountcCs>|ttjdd|ttjd|tjjtj udS)Nri5w) rrr _getframer#rrG test_getframe__code__f_coderIrrrrGszSysModuleTest.test_getframecsrddlddl}gfdd}fddj|d}||tdd}t }|D]}| |t | |dq }||||||||}||tu||}||} t| D]\} \} } } }| dkrq"q|d ||d | | d\} } } }|| d ||d d g|dS)Nrcs dSr!rr)g456rrf123\sz/SysModuleTest.test_current_frames..f123cs"dSr!)append get_identsetwaitr) entered_gleave_g thread_info threadingrrr_sz/SysModuleTest.test_current_frames..g456)targetrArz)didn't find f123() on thread's call stackzg456()rzleave_g.wait()zentered_g.set())r tracebackEventThreadstartrr rr _current_framesr]r assertGreaterrr>poprr extract_stack enumerateZfailrjoin)rrrtZ thread_iddtidZmain_idframestackifilenamelinenofuncnameZ sourceliner)rrrrrrtest_current_framesPsB           z!SysModuleTest.test_current_framescCs||tjt|tjt|tjd|tjt |tj t |tj t |tj t |tjt |ttjd|tjjd|ttjd|tjjddk|tjjdk|tjjd|tjjd |tjjtjj|ttjjt|ttjjt|tjjt|tjjt|tjt|ttjd |tjjdtjj t!dd D]2}|t"|tjjdtjjdd #tjjq|tjj$t|tjj%t|tjj&tt'(d }tjj)d vr||tjj*ddh|tjj+hd|dkrJ|tjj)dn0|dkrf|tjj)dn|tjj)ddhn ||d|tjj,d|tjj,d|tj-t|tj.t|tj.d|tj/t |tj0t |tj1t |tj2t |tj3t tj4}||ddt |t|d||dt||dt||dt||dd||dt||j5t||j6t||j7t||j8d||j9t||d|j5||d|j6||d|j7||d|j8||d|j9||dk|tj:t |tj:dtj/;dsx|tj siphash24fnv @>rrrriralphabeta candidatefinal)rArr)Zshortlegacywin)=r]r api_versionrargvlistr> byteorderbuiltin_module_namestuple copyrightr^ exec_prefixbase_exec_prefix executabler r float_inforadixint_inforbits_per_digit sizeof_digitassertGreaterEqualdefault_max_str_digitsstr_digits_check_thresholdrr hexversion hash_info assertLessmoduluswidthrangepowformatinfnanimag sysconfigZget_config_var algorithm hash_bits seed_bitscutoffmaxsize maxunicoderprefix base_prefix platlibdirversion version_inforrmicro releaselevelserialfloat_repr_stylerQabiflags)rxZalgovirrrtest_attributess     zSysModuleTest.test_attributescCs6tj}|t|d||jd||jddS)Nr)ntZpthreadZsolarisN) semaphorez mutex+condN)r rr rr>namelock)rinforrrtest_thread_infoszSysModuleTest.test_thread_infocCs|tjjtjjdSr!)r r __stdout__encoding __stderr__rIrrr test_43581szSysModuleTest.test_43581cCs~td7a|ttjdtt}|t||u|}|t||uGdddt}|ttj|ddS)NrAznever interned beforec@seZdZddZdS)z$SysModuleTest.test_intern..ScSsdS)Nr7rrIrrr__hash__sz-SysModuleTest.test_intern..S.__hash__N)r(r)r*r rrrrSsr abc)INTERN_NUMRUNSrrr internr^rswapcase)rss2r rrr test_interns  zSysModuleTest.test_interncCs|tjd}|D]B}|ttj|||dkr8tnt}|tttj|||q|t tj|t tjt || tjj hddS)N)debuginspect interactiveoptimizedont_write_bytecode no_user_siteno_siteignore_environmentverbose bytes_warningquiethash_randomizationisolateddev_mode utf8_modeint_max_str_digitsr>rrAr) rr flagsrboolrr rgetattrreprrr>r )rattrsattr attr_typerrrtest_sys_flagss zSysModuleTest.test_sys_flagscCspt|}|t|Wdn1s.0Y|t||Wdn1sb0YdSr!)rrr__new__)rZsys_attrr(rrrassert_raise_on_new_sys_types  $ z*SysModuleTest.assert_raise_on_new_sys_typecCs|tjdSr!)r+r r"rIrrrtest_sys_flags_no_instantiation"sz-SysModuleTest.test_sys_flags_no_instantiationcCs|tjdSr!)r+r rrIrrr&test_sys_version_info_no_instantiation%sz4SysModuleTest.test_sys_version_info_no_instantiationcCs tjtd|tdS)Nr)rCrrr r+rrIrrr+test_sys_getwindowsversion_no_instantiation(sz9SysModuleTest.test_sys_getwindowsversion_no_instantiationcCs tdSr!)r _clear_type_cacherIrrrtest_clear_type_cache-sz#SysModuleTest.test_clear_type_cachecCsttj}d|d<tjtjddgtj|d}|d }dtj  d}| ||d|d<tjtjddgtj|d}|d }| |d d |d<tjtjddgtjtj|d }|\}}| |d | d || d|d|d<tjtjddgtjtj|d }|\}}| |d | d || d|d|d<tjtjddgtj|d}|d }| |ddS)Ncp424rVrKzprint(chr(0xa2))renvr¢z ascii:replace?rR)rr@r3rLsUnicodeEncodeError:s'\xa2'zascii:z:surrogateescapezprint(chr(0xdcbd)))dictosenviron subprocessPopenr rPIPE communicatestriplinesepencoder r>)rr3prrSr3rrrtest_ioencoding1sL           zSysModuleTest.test_ioencodingz*requires OS support of non-ASCII encodingsFz$requires FS encoding to match localecCs^ttj}d|d<tjtjddtjj gtj |d}| d }| |ttjj dS)NrrVrKz print(%a)r2r)r7r8r9r:r;r rrCr FS_NONASCIIr<r=r>r fsencode)rr3rArrrrtest_ioencoding_nonascii\s   z&SysModuleTest.test_ioencoding_nonasciizTest is not venv-compatiblec Cs|tjtjtjtjtjtj}tj gdtjtj |d}| d}| d}|||dttjddgdS)N)Z nonexistentrKzEimport sys; print(sys.executable.encode("ascii", "backslashreplace")))rrcwdrASCIIzb''rRbackslashreplace)r r8pathabspathr rdirnamerealpathr:r;r<r=r>decoderr>r%r@)rZ python_dirrArrrrrtest_executablejs  zSysModuleTest.test_executableNcCs(||t||r$|||dSr!)ZassertIsNotNonecodecslookupr rZ fs_encodingrSrrrcheck_fsencodings  zSysModuleTest.check_fsencodingcCs,t}tjdkrd}nd}|||dS)Ndarwinzutf-8)r getfilesystemencodingrrRrQrrrtest_getfilesystemencodings  z(SysModuleTest.test_getfilesystemencodingc Cstj}||d<d|d<dd}tjddd|g}|rB|d |durT||d <n |d dtj |tj tj |d d }| \}} |S) NLC_ALL0ZPYTHONCOERCECLOCALE ) import syszdef dump(name):z std = getattr(sys, name)z( print("%s: %s" % (name, std.errors))z dump("stdin")zdump("stdout")zdump("stderr")z-Xzutf8=0rKz-IrVT)rr@r3universal_newlines) r8r9copyrr rrrr:r;r<STDOUTr=) rlocalerrr3rargsrArr@rrrc_locale_get_error_handlers$      z(SysModuleTest.c_locale_get_error_handlercCs|j|dd}||d|j|dd}||d|j|dd}||d|j|d d}||d|j|d d}||d|j|d d}||ddS) NT)rzHstdin: surrogateescape stdout: surrogateescape stderr: backslashreplace z:ignore)rz6stdin: ignore stdout: ignore stderr: backslashreplace z iso8859-1z6stdin: strict stdout: strict stderr: backslashreplace z iso8859-1::r)r_r )rr]rrrrcheck_locale_surrogateescapes0z*SysModuleTest.check_locale_surrogateescapecCs|ddS)NCrarIrrrtest_c_locale_surrogateescapesz+SysModuleTest.test_c_locale_surrogateescapecCs|ddS)NZPOSIXrcrIrrr!test_posix_locale_surrogateescapesz/SysModuleTest.test_posix_locale_surrogateescapecCsddddd}|ttjd|ttjd|ttjd|ttjd tjj}||dd |j|jf|jd >|jd >B|jd >B||j d>B|j d>B}|tjj ||tjj tjj dS)Nrlr rrrr cache_tagrrrr)rrr implementationrr rrrrrrrlower)rZlevelsrrrrrtest_implementations$   z!SysModuleTest.test_implementationcCsBddlm}ddg}||\}}}|d||ttjddS)Nr)rrKz#import sys; sys._debugmallocstats()sfree PyDictObjectsT)test.support.script_helperrr>rrr _debugmallocstats)rrr^retrr3rrrtest_debugmallocstatss   z#SysModuleTest.test_debugmallocstatsgetallocatedblocksz0sys.getallocatedblocks unavailable on this buildc Csz ddl}Wnty&t}Yn@0z |}Wn(ty\}zd}WYd}~nd}~00|dv}t}|t |t |r| |dn | |dz| |tWntyYn0tt}|||tt}||t|d|ddS)NrT)ZpymallocZpymalloc_debugrn) _testcapi ImportErrorr with_pymallocZpymem_getallocatorsnamerr rrassertIsrrrrrrAttributeErrorgcZcollectZassertLessEqualr>r)rrsruZ alloc_namer2r`brrrrtest_getallocatedblockss0      z%SysModuleTest.test_getallocatedblockscCs8|tdd}td|\}}}||ddS)NFaif 1: import sys class AtExit: is_finalizing = sys.is_finalizing print = print def __del__(self): self.print(self.is_finalizing(), flush=True) # Keep a reference in the __main__ module namespace, so the # AtExit destructor will be called at Python exit ref = AtExit() rKsTrue)rvr is_finalizingrr rstriprrrTrr@rrrtest_is_finalizing!sz SysModuleTest.test_is_finalizingcCs@d}td|\}}}|}|d|d|d|ddS)Nzif 1: import sys class A: def __del__(self, sys=sys): print(sys.flags) print(sys.float_info) a = A() rKs sys.flagsrssys.float_inforA)r splitlinesr>rrrTrr3rrrtest_issue206026s zSysModuleTest.test_issue20602cCsDd}td|\}}}||d||d||ddS)Nzif 1: import struct, sys class C: def __init__(self): self.pack = struct.pack def __del__(self): self.pack('I', -42) sys.x = C() rKrrL)rr r|r}rrr&test_sys_ignores_cleaning_up_user_dataEs   z4SysModuleTest.test_sys_ignores_cleaning_up_user_datagetandroidapilevelzneed sys.getandroidapilevel()cCs$t}||t||ddS)Nr)r rr]rr)rlevelrrrtest_getandroidapilevelVs z%SysModuleTest.test_getandroidapilevelcsdfdd}gd}|d||d||d|dd|dd|d|dd|dd|d |d g|d |d g|dd >||d d >|d g|d|dS) Nzif 1: import sys def f1(): 1 / 0 def f2(): f1() sys.tracebacklimit = %r f2() cs<tjtjd|gtjd}|d}||dS)NrK)r@rA)r:r;r rr<r=r r)tracebacklimitrSrArrrrrcheckgs  z4SysModuleTest.test_sys_tracebacklimit..check)s"Traceback (most recent call last):s& File "", line 8, in s File "", line 6, in f2s File "", line 4, in f1s#ZeroDivisionError: division by zerorlrrrArrrr)rrrrrrtest_sys_tracebacklimit]s   z%SysModuleTest.test_sys_tracebacklimitcCs |ttjtttjdSr!)r rr meta_pathrrIrrrtest_no_duplicates_in_meta_path~sz-SysModuleTest.test_no_duplicates_in_meta_pathZ_enablelegacywindowsfsencodingz*needs sys._enablelegacywindowsfsencoding()cCs:d}tdd|\}}}|dd}||ddS)N)rYz$sys._enablelegacywindowsfsencoding()zCprint(sys.getfilesystemencoding(), sys.getfilesystemencodeerrors())rKz; rRreplacez mbcs replace)rrrMr|r rrrr#test__enablelegacywindowsfsencodingsz1SysModuleTest.test__enablelegacywindowsfsencoding)N)FN)=r(r)r*rJr[r_rdrhrurCr cpython_onlyr~rrunittestZ skipUnlessrr rZ refcount_testrrZ reap_threadsrrrrrr)r+r,r-r.r0rBrCrTr]getpreferredencodingrEZskipIfrrrNrRrUr_rardrermrqrzr~rrrrrrrrrrrGosB       @X  +     &  '  ! rGc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)UnraisableHookTestcCsTddl}ddl}d|}z.|||||jt|||j||dWd}Sd}0dS)NrException ignored )exc_type exc_value exc_tracebackerr_msgobject)rstypeswrite_unraisable_excSimpleNamespacer __traceback__)rr2rr$rsrZerr_msg2rrrrs  z'UnraisableHookTest.write_unraisable_excc CsdD]}|j|dd}tjdT}tjtdtj"|td||Wdn1sb0YWdn1s0Y| }|dur| d|d|d |n| d |d || d || d |Wdq1s0YqdS) N)Nz original hook)rz an objectr@unraisablehookrrz: rXzException ignored in: #Traceback (most recent call last): r,) subTestrCrrDr&r __unraisablehook__rr#r r>)rrr$r@r3rrrtest_original_unraisablehooks N z/UnraisableHookTest.test_original_unraisablehookc s\Gddd}GdddtGfddd}||fD]}|||}tjD}tjtdtj~Wdn1s0YWdn1s0Y|}| d|| |j j || d || d |||ur| d|| d |n| d || d || | dWdq81sL0Yq8dS)Nc@seZdZddZdS)zFUnraisableHookTest.test_original_unraisablehook_err..BrokenDelcSstd}|dS)N del is brokenr"rr2rrr__del__szNUnraisableHookTest.test_original_unraisablehook_err..BrokenDel.__del__Nr(r)r*rrrrr BrokenDelsrc@seZdZddZdS)zOUnraisableHookTest.test_original_unraisablehook_err..BrokenStrExceptioncSs tddS)Nzstr() is broken ExceptionrIrrr__str__szWUnraisableHookTest.test_original_unraisablehook_err..BrokenStrException.__str__N)r(r)r*rrrrrBrokenStrExceptionsrcseZdZfddZdS)zOUnraisableHookTest.test_original_unraisablehook_err..BrokenExceptionDelcs}|dSr!rrrrrrszWUnraisableHookTest.test_original_unraisablehook_err..BrokenExceptionDel.__del__NrrrrrBrokenExceptionDelsrrzException ignoredz test_sys.pyz raise exczr#rrX)rrrCrr-r&r rr r>rr*rr0)rrrZ test_classr$r@reportrrr test_original_unraisablehook_errs.   >       z3UnraisableHookTest.test_original_unraisablehook_errc CsGddd}tjV}tjtdtj$||jdd}Wdn1sV0YWdn1st0Y| }d}| |d|dS)Nc@seZdZGdddZdS)zMUnraisableHookTest.test_original_unraisablehook_exception_qualname..Ac@seZdZGdddeZdS)zOUnraisableHookTest.test_original_unraisablehook_exception_qualname..A.Bc@s eZdZdS)zQUnraisableHookTest.test_original_unraisablehook_exception_qualname..A.B.XNr(r)r*rrrrXsrN)r(r)r*rrrrrrBsrN)r(r)r*rrrrrAsrrr6r$/test_original_unraisablehook_exception_qualnamez..A.B.X) rCrr-r&r rrrrr r>)rrr@rSrZtestNamerrrrs   @zBUnraisableHookTest.test_original_unraisablehook_exception_qualnamec Csrtd}tjtdtjD|tt|Wdn1sF0YWdn1sd0YdS)Nrr) r#rCrr&r rrrrrrrr'test_original_unraisablehook_wrong_types   z:UnraisableHookTest.test_original_unraisablehook_wrong_typecsdfdd}t}zztjtd|N|tdd|}dD]"}|t |t |||fqDWdn1s|0YWd}dn d}d0dS)Ncs|dSr!rr^Z hook_argsrr hook_funcsz@UnraisableHookTest.test_custom_unraisablehook..hook_funcrrz custom hookz/exc_type exc_value exc_traceback err_msg object) rrCrr&r rr#splitr r$)rrr$rSr'rrrtest_custom_unraisablehooks"    &z-UnraisableHookTest.test_custom_unraisablehookc Csdd}tjdR}tjtd|"|tdddWdn1sN0YWdn1sl0Y|}|d|d||d ||d |dS) NcWs tddS)Nzhook_func failedrrrrrrszEUnraisableHookTest.test_custom_unraisablehook_fail..hook_funcr@rrzcustom hook failz)Exception ignored in sys.unraisablehook: rXrzException: hook_func failed ) rCrrDr&r rr#r r>)rrr@r3rrrtest_custom_unraisablehook_fails @ z2UnraisableHookTest.test_custom_unraisablehook_failN) r(r)r*rrrrrrrrrrrrs(rcsleZdZddZejjZddZddZddZ fd d Z d d Z d dZ ddZ ddZddZZS) SizeofTestcCs*td|_tjj|_ddl}|j|_ dS)NPr) structcalcsizerr rr longdigitr}ZSIZEOF_PYGC_HEAD gc_headsize)rr}rrrsetUps  zSizeofTest.setUpcCsHtjj}|j}|td|d|j|tg|d|dS)NTrPn)rCr calcvobjsizerr r getsizeofr)rvsizeZgc_header_sizerrrtest_gc_head_sizeszSizeofTest.test_gc_head_sizecCsGddd}|ttj|Gddd}|ttj|dg}|t|||Gddd}|ttj||t|||Gdd d t}|t|tjtj|j |t $t|tjd Wdn1s0Y|tt|d Wdn1s00Y|tt f&t|tj d Wdn1sv0YdS) Nc@seZdZddZdS)z)SizeofTest.test_errors..BadSizeofcSstdSr!r"rIrrr __sizeof__)sz4SizeofTest.test_errors..BadSizeof.__sizeof__Nr(r)r*rrrrr BadSizeof(src@seZdZddZdS)z-SizeofTest.test_errors..InvalidSizeofcSsdSr!rrIrrrr.sz8SizeofTest.test_errors..InvalidSizeof.__sizeof__Nrrrrr InvalidSizeof-srsentinelc@seZdZddZdS)z+SizeofTest.test_errors..FloatSizeofcSsdS)Ng@rrIrrrr5sz6SizeofTest.test_errors..FloatSizeof.__sizeof__Nrrrrr FloatSizeof4src@seZdZddZdS)z.SizeofTest.test_errors..OverflowSizeofcSst|Sr!)rrIrrrr;sz9SizeofTest.test_errors..OverflowSizeof.__sizeof__NrrrrrOverflowSizeof:srrAr) rr#r rrrvrr rr OverflowError)rrrrrrrrr test_errors's&  2 .zSizeofTest.test_errorscCsFtjj}|td|d|j|tdd|d|jdS)NTrr)rCrrr r rr)rsizerrr test_defaultFszSizeofTest.test_defaultc' sJ tj}tjjtjj}jd|djtddddg}|D]"}t |}||d| qNt t dd|d d d |d d d d}|j ddfdd}||j d||j ddd}||j d|d tdd dtjdddl} | jjdddl} | jjdtjdijdiddd id|ddd|d d d!d"d#dd$d%dd&} | d|dd'd(|d idididt id)t id)t id)t id)Gd*d+d+t} | jdtd,t dddddd-t!dddddd-t"ddd dd-t#dddl$} ddl%}| &|j'j(}|d.t)gd/t*ddt+dd0t,j-|dj.tt,j-ddl/}d1}|0}t|j1j2}t|j1j3}|j1j4|j1j5||d }||d2|d3d|dd4d5}|d6Gfd7d8d8}d9d:}|d;t d<d=ddl6}|7dddggd>gd?g}|D]&}t8||d@t|j.qt gd=t*gdd|dd |djdA|djd!t,j9j:}t||dd!jt|d!d |dd!jt|d!|dd"jt;dBddt<dtdGfdCd+d+t} t t=d dDt*ddt=d dEt=dFdEd}gt=d(t=dGg}dH|ddI}|D]}t|}|dkr\d }|d!}|}||kr~|d >}qh|dkrt>||t?||n4t>||||dt?||||dqBt t>dJt@ddKtAtdKdL|dd>|dd"j.dM}||}t|||dN}GdOdPdPt}|||dQdd|d |jddj.|} d | _B| _C| _D| _E| _F| _G| _H| _I|||dQd'd(|d |jdd(j.gdR}dS}!|!dT}"|"d}#|D]}tJtK|}$|$dUkrp|!t|d }%n\|$dVkr|"t|d }%n<|$dWkr|"d!t|d }%n|"d#t|d }%||%q@tLdX}||"d#tM|dYdZ||"d#d#ddlN}&|&Otd[|&Ptd[dS)\NTrZ5PrLuiZn2PiZnPrcrAs xxxxxxxxxxrcsdfdd}|S)NrcsSr!rrrrrinnerdsz.get_cell..innerr)rrrrget_cellbs z-SizeofTest.test_objecttypes..get_cellrrcst||dSr!)rr r)r`Z expected_sizerIrrcheck_code_sizeisz4SizeofTest.test_objecttypes..check_code_sizeZ6i13Pcsfdd}|S)NcsSr!rrrrrrnsz=SizeofTest.test_objecttypes..get_cell2..innerr)rrrrr get_cell2ms z.SizeofTest.test_objecttypes..get_cell2Z2dZ3PPPZ3PPZ3P2PZ2PZnQ2Pr`Z2nP2nrrZn2Prrr)rArrrrrrrrjrlZP2nPnc@s eZdZdS)&SizeofTest.test_objecttypes..CNrrrrrrbrLrbZ5Pbz 5Pb 2P2nPZ32B2iBZn3PrZ 5P2c4P3icZ3icSsdSr!rrrrrfuncrLz)SizeofTest.test_objecttypes..funcZ13Pcs@eZdZeddZeddZededdS)z&SizeofTest.test_objecttypes..ccSsdSr!rrrrrfoosz*SizeofTest.test_objecttypes..c.foocSsdSr!r)clsrrrbarsz*SizeofTest.test_objecttypes..c.barZPPN)r(r)r* staticmethodr classmethodrrrrrrrs   rcss dVdS)NrArrrrrget_genrLz,SizeofTest.test_objecttypes..get_genZPb2PPP4Pr ZlP)rArr)rB23rrZPnPPPcs@eZdZddZddZddZeeeedZedd S) rcSs|jSr!Z_C__xrIrrrgetxrLz+SizeofTest.test_objecttypes..C.getxcSs ||_dSr!r)rvaluerrrsetxrLz+SizeofTest.test_objecttypes..C.setxcSs|`dSr!rrIrrrdelxrLz+SizeofTest.test_objecttypes..C.delxrZ4PiN)r(r)r*rrrpropertyrrrrrrbs Z4lZ4PirnZ3nPZ2nPZP3n3PrZP2nPI13Pl4Pn9Pn11PIPPZ3P36P3P10P2P5Pc@s eZdZdS)z2SizeofTest.test_objecttypes..newstyleclassNrrrrr newstyleclass$rLrZ2nP2n0P)Zd1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111udÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿuPĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀu,￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿ux𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀u􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿ZnnbPZnPnrii@zrZ2Pn2P)QrrrCr calcobjsizer check_sizeofrr bytearray __alloc__iter __closure__rcomplexr^rldatetimeZ timedeltaZdays collections defaultdictdefault_factoryr__add____iter__keysvaluesitemsr__dict__ BaseExceptionUnicodeEncodeErrorUnicodeDecodeErrorUnicodeTranslateErrorEllipsisrOZencodings.iso8859_3 charmap_build iso8859_3Zdecoding_tablerreversedfloatr rrr currentframer co_cellvars co_freevars co_stacksize co_nlocalsrefinditerrrrrNotImplementedrr frozensetslicesuperr`ryrrerkghordmaxchrrweakrefrefproxy)'rrrZsamplessamplerrrrrrZlongdictrbrO encodingsrZ CO_MAXBLOCKSZncellsZnfreesextrasrrrrZ PyLong_BASEZ PySet_MINSIZErZminusedtmpZnewsizefmtroZ asciifieldsZ compactfieldsZ unicodefieldsZmaxcharLr __class__)rrrrtest_objecttypesKs*  *&   " $ $      "0"     zSizeofTest.test_objecttypescCsHt|t|}t|r2t|s2||j7}|t||dSr!)r rrrrxZ is_trackedrr )rr$baseextrarSrrr check_slotsUs zSizeofTest.check_slotsc Cs|j}Gdddt}||tdGdddt}||gddgidGdd d t}||gdGd d d t}||tdGd d d t}||tdddlm}Gddd|}||gd|gdddS)Nc@seZdZdZdS)z!SizeofTest.test_slots..BAr`ryrNr(r)r* __slots__rrrrBA_sr-rc@seZdZdZdS)z SizeofTest.test_slots..Dr*Nr+rrrrDbsr.rrc@seZdZdZdS)z SizeofTest.test_slots..Lr*Nr+rrrrr#esr#c@seZdZdZdS)z SizeofTest.test_slots..Sr*Nr+rrrrr hsr c@seZdZdZdS)z!SizeofTest.test_slots..FSr*Nr+rrrrFSksr/r) OrderedDictc@seZdZdZdS)z!SizeofTest.test_slots..ODr*Nr+rrrrODosr1)r)rr7rrrrr0) rrr-r.r#r r/r0r1rrr test_slots[s zSizeofTest.test_slotscCstjj}tjj}|j}ddl}|||dztWn4tylt d}|durh|||dYn0|tj |d|j t tj dS)NrrrZ2P2ir) rCrrrr_astZASTrr r/r"rr)rrrrr3tbrrrtest_pythontypesss  zSizeofTest.test_pythontypescCst}||j||jdd}tj|dt}||j|||d|||jd||dddd}tj|dt}||j|||d|||j|||d|tj|t}||j||jdS)NcWsdSr!rr`rrrrLz0SizeofTest.test_asyncgen_hooks..) firstiterrrAcWsdSr!rr6rrrr7rL) finalizer)r get_asyncgen_hooksrXr8r9set_asyncgen_hooksrv)roldr8Zhooksr9Zcurrrrtest_asyncgen_hookss*      zSizeofTest.test_asyncgen_hookscCs6td}td|\}}}||d||ddS)Nz import sys class MyStderr: def write(self, s): sys.stderr = None sys.stderr = MyStderr() 1/0 rKrL)textwrapdedentrr rrrr/test_changing_sys_stderr_and_removing_references  z:SizeofTest.test_changing_sys_stderr_and_removing_reference)r(r)r*rrCrrrrrr&r)r2r5r=r@ __classcell__rrr$rrs   r__main__)rCrrnrrr rOrxr]rr8rr:r rZ test.supportr>rr9r ZTestCaserr+rGrrrr(mainrrrrsF /(#