+
    Bi%                         ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIt^ RIH	t	 ^ RI
Ht ^ RI
Ht ^RIHt ^RIHt  ^ R	IHt R tR tR R ltR tR R ltR#   ] d    ^ RItR
 t L'i ; i)    N)
isabstract)Any)support)	os_helper)refleak_helper)HuntRefleak)clear_caches)	_get_dumpc                     \        R  V P                   4       4      pWP                  V P                  V P                  3# )c              3   N   "   T F  p\         P                  ! V4      x  K  	  R # 5iN)weakrefref).0objs   & //usr/lib/python3.14/test/libregrtest/refleak.py	<genexpr>_get_dump.<locals>.<genexpr>   s     N<MSC 0 0<Ms   #%)set_abc_registry
_abc_cache_abc_negative_cache_abc_negative_cache_version)clsregistry_weakrefss   & r   r
   r
      s?      NC<M<MNN!>>'')H)HJ 	J    c                     \         P                  f   R # ^ R Ip\        V R4      ;_uu_ 4       pVP	                  \         P                  V4       R R R 4       R \         n        R #   + '       g   i     L; i)Nxb)r   junit_xml_listpickleopendump)filenamer    fps   &  r   save_support_xmlr%      sM    %	h		G**B/ 
!G 
	s   !A##A3	c                      \        V R 4      p^ RIpT;_uu_ 4        TP                  T4      pRRR4       \        P
                  ! T 4       X\        n        R#   \         d     R# i ; i  + '       g   i     LE; i)rbN)r!   FileNotFoundErrorr    loadosunlinkr   r   )r#   r$   r    xml_lists   &   r   restore_support_xmlr-   &   s_    (D! 	;;r? 
IIh%G   
s   A A+A('A(+A;	c                0    V ^8  d   QhR\         R\        /# )   hunt_refleakquiet)r   bool)formats   "r   __annotate__r4   4   s      q q"-qqr   c           
       a7 ^ RI p^ RIp\        \        R4      '       g   \	        R4      h\        4        \        P                  R,          pVP                  P                  4       p\        P                  P                  4       p\        P                  P                  4       \        P                  P                  4       3p	 ^ RIp
V
P                  P                  4       p/ pVP"                  P$                   Uu. uF  p\'        VP"                  V4      NK  	  up FI  p\)        V4      '       g   K  VP+                  4       V.,            F  p\-        V4      ^ ,          W&   K  	  KK  	  \/        R"R4       Uu/ uF  pVVbK  	  upo7V73R lpVP0                  pVP2                  pVP4                  pVV,           p\7        \/        V4      4      p^ .V,          p^ .V,          p^ .V,          p\        P8                  p\        P:                  p\        P<                  p\>        P@                  p^ ;p;p;p p!V'       gj   \C        RVR\        PD                  R	7       R
V^
,          ^,           ,          RV p"V"RV R,           V"VR ,           p"\C        V"\        PD                  RR7       Rp#Rp$\G        WgWW4       V EFl  p%\H        PJ                  ! 4        \L        PN                  p&R\L        n'         V! 4       p$V&\L        n'        \Q        V#4       \G        WgWW4       \H        PJ                  ! 4        V! RR7      p'V! 4       V',
          p(V! 4       p)V! 4       p*V! V)V,
          4      VV%&   V! V(V,
          4      VV%&   V! V*V ,
          4      VV%&   V'       g   \S        VV%,          VV%,          VV%,          4      p+V+^ 8:  d   Rp,MV+^
8  d   R#V+,          p,MRp,V%V8X  d   \C        RR\        PD                  RR7       \C        V,R\        PD                  RR7       ?+?,T(pT)pT*p T'p!\U        V#4       EKo  	  V'       g   \C        \        PD                  R	7       R p-R p.Rp/VRV-3VRV-3VRV.33 F  w  p0p1p2V0VR p0V2! V04      p3\W        V04      p4V3'       g   V4'       g   K1  V : RV0: RV1: R\Y        V04      : 2p5\C        V5R\        PD                  R7       V3'       d\   \C        \        PD                  RR7       \[        VRRR 7      ;_uu_ 4       p6\C        V5V6R	7       V6P]                  4        RRR4       Rp/K  \C        R!\        PD                  RR7       K  	  V/V$3#   \          d    Rp EL~i ; iu upi u upi   T&\L        n'        i ; i  + '       g   i     Lf; i)$zRun a test multiple times, looking for reference leaks.

Returns:
    False if the test didn't leak references; True if we detected refleaks.
Ngettotalrefcountz9Tracking reference leaks requires a debug build of PythonNNNi  c                 &   < SP                  W 4      # r   )
setdefault)valueint_pools   &r   get_pooled_int'runtest_refleak.<locals>.get_pooled_inte   s    ""500r   	beginningzHrepetitions. Showing number of leaks (. for 0 or less, X for 10 or more))file
1234567890:T)r?   flushzrefleak-xml.tmp)_only_immortal.X  )endr?   rB   c                 j    \         ;QJ d    R  V  4       F  '       d   K   R# 	  R# ! R  V  4       4      # )c              3   *   "   T F	  q^8  x  K  	  R# 5i)   N )r   deltas   & r   r   ;runtest_refleak.<locals>.check_rc_deltas.<locals>.<genexpr>   s     26%A:6s   FT)alldeltass   &r   check_rc_deltas(runtest_refleak.<locals>.check_rc_deltas   s-     s262ss2s2s26222r   c                     \        V 4      # r   )anyrP   s   &r   check_fd_deltas(runtest_refleak.<locals>.check_fd_deltas   s    6{r   F
referenceszmemory blockszfile descriptorsz leaked z, sum=)rH   r?   azutf-8)encodingz (this is fine)i)
rD   123456789)/copyregcollections.abchasattrsys	Exceptionwarm_cacheswarningsfiltersdispatch_tablecopypath_importer_cache	linecachecache_interactive_cache	zipimport_zip_directory_cacheImportErrorabc__all__getattrr   __subclasses__r
   rangewarmupsrunsr#   listgetallocatedblocksr6   getunicodeinternedsizer   fd_countprintstderrdash_R_cleanupr   
gc_collectr   _hunting_for_refleaksr%   maxr-   rU   sumr!   rB   )8	test_name	test_funcr0   r1   rd   collectionsfspspiclinecache_datarr   zdcabcsrY   ru   r   r:   r<   rz   r{   r#   repcount	rep_range	rc_deltasalloc_deltas	fd_deltasr}   r6   r~   r   	rc_beforealloc_before	fd_beforeinterned_immortal_beforenumbersxml_filenameresulticurrentinterned_immortal_afteralloc_afterrc_afterfd_aftertotal_leakssymbolrR   rV   failedrQ   	item_namecheckerfailing
suspiciousmsgrefrepr;   s8   &&&&                                                   @r   runtest_refleakr   4   s    3*++ $ % 	%
 M 
		!	B				$	$	&B

!
!
&
&
(C __))+Y-I-I-N-N-PPN4
 ,,113D5@__5L5LM5L+5LM#%%'3%//C!#q)DI 0 N +0t*<=*<u*<=H1 ""GD$$H~H U8_%IhI3>LhI//++ 77!!HFGGIGGy+Ck8 &6::	  2!12IX>(7#c)GGH,==gCJJd3$LF23T: 66/3,	;[F3:N0&rs> #9#! )*-DD#%:%h&:;	!(|)CDQ%h&:;	!ilLOYq\JKar!!# G|cr

$?&bszz>"		#: L)e h 3::3 F	L/2	8	&8'"	7 !&/[
jj69c&k;C#2CJJ/3::T2(C'::f#F+LLN ; 'cjjE)'* Fc   N >P 4;N0f ;:s6   U 9U!6U&+U+?U;UU+U8;Vc                    ^ RI p^ RIpV \        P                  R&   VP                  P                  4        VP                  P                  V4       \        P                  P                  4        \        P                  P                  V4       Vw  r\        P                  P                  4        \        P                  P                  V	4       \        P                  P                  4        \        P                  P                  V4        ^ RIp
V
P                  P                  4        V
P                  P                  V4       VP                  P                    Uu. uF  p\#        VP                  V4      NK  	  pp\%        \&        V4      pV F  pVP)                  4       V.,            F`  pVP+                  VR4      pVe8   VP-                  4        V F!  pV! 4       pVf   K  VP/                  V4       K#  	  VP1                  4        Kb  	  K  	  \3        4        \        P4                  ! 4        R#   \         d     Li ; iu upi )r   Nr7   )rd   re   rj   rk   rl   clearupdaterg   rn   ro   rq   rp   rr   rs   rt   ru   rv   rw   filterr   rx   get_abc_registry_clearregister_abc_caches_clearr	   _clear_internal_caches)r   r   r   r   r   r   rd   r   lcachelinteractiverr   rY   abs_classesru   r   refsr   subclasss   &&&&&&            r   r   r      s    HQ  "!!"%!!#""3')F  &&(  ''5OOOO6"3 	&&,,.&&--c2 9D8O8OP8O17;??A.8OKP[1K%%'3%//C88C&D'')C"uH+X.   !!# 0  N  1   Qs   H5 I5IIc                    V ^8  d   QhRR/# )r/   returnNrL   )r3   s   "r   r4   r4     s      T r   c                      \        \        R 4      4      p \        R 4       F  pWV^,             K  	  \        R 4       Uu. uF  p\        V4      NK  	   p\        \        RR4      4       R# u upi )   i  N)bytesry   chrr|   )sr   s     r   ri   ri     sX    eCjA3Z	AaC  3Z ZSVZ r3 !s   A,)r*   rg   rj   inspectr   typingr   ro   testr   test.supportr   r   runtestsr   utilsr	   _abcr
   rt   r   r%   r-   r   r   ri   rL   r   r   <module>r      sh    	 
      " ' ! 
J"&qh)!XG  JJJs   A A*)A*