+
    Xj-5                        ^ RI t ^ RIt^ RIt^ RIHt ^ RIt^ RIt] P                  P                  R4      t	] P                  P                  R4      ;'       g    ]	t
] P                  P                  R4      t]
;'       g    ]t] P                  P                  R4      t];'       g    ] P                  P                  R4      t] P                  P                  R4      t] P                  P                  R	4      tR
 tR tR tR t ! R R]4      t]! ]R4      '       d    ! R R]4      t]! 4       ]n        ]tMR t ! R R]4      t ! R R]4      tR tR# )    N)wrapsGITHUB_ACTIONSTRAVISAPPVEYORGREENLET_MANYLINUXGREENLET_SKIP_LEAKCHECKS GREENLET_SKIP_FAILING_LEAKCHECKS GREENLET_ONLY_FAILING_LEAKCHECKSc                    RV n         V # )a  
Ignore the given object during leakchecks.

Can be applied to a method, in which case the method will run, but
will not be subject to leak checks.

If applied to a class, the entire class will be skipped during leakchecks. This
is intended to be used for classes that are very slow and cause problems such as
test timeouts; typically it will be used for classes that are subclasses of a base
class and specify variants of behaviour (such as pool sizes).
T)ignore_leakcheckfuncs   &u/Users/jameslopez/projects/FindRefurbishedAppleProduct/.venv/lib/python3.14/site-packages/greenlet/tests/leakcheck.pyignores_leakcheckr   J   s     !DK    c                   a a V V3R lpV# )z
Return a decorator that marks the function to be ignored during
leakchecks (see `ignores_leakcheck`) when *condition* is true.

*message* describes why the leakcheck is ignored. When *condition*
is false, the function is returned unchanged.
c                 <   < S'       d   \        V 4      p SV n        V # N)r   ignore_leakcheck_reason)r   	conditionmessages   &r   	decorator'ignores_leakcheck_if.<locals>.decoratora   s    $T*D+2D(r    )r   r   r   s   ff r   ignores_leakcheck_ifr   Y   s    
 r   c                d    RV n         \        '       d   \        P                  ! R4      ! V 4      p V # )z*
Mark that the function is known to leak.
TzSkipping known failures)fails_leakcheckSKIP_FAILING_LEAKCHECKSunittestskipr   s   &r   r   r   h   s+      D}}67=Kr   c                T    \         P                  R,          R8:  d   \        V 4      # V # )zX
Mark the function as known to leak (fails refcount leakchecks) on Python 3.14 or less.
:N   N)      )sysversion_infor   r   s   &r    fails_leakcheck_on_py314_or_lessr'   q   s'     w&t$$Kr   c                       ] tR t^ytRtR# )LeakCheckErrorr   N)__name__
__module____qualname____firstlineno____static_attributes__r   r   r   r)   r)   y   s    r   r)   
getobjectsc                   ,   a  ] tR t^t o R tR tRtV tR# )_MockGCc                .    \         P                  ! ^ 4      # )r   )r%   r/   selfs   &r   get_objects_MockGC.get_objects   s    >>!$$r   c                "    \        \        V4      # r   )getattrgc)r4   names   &&r   __getattr___MockGC.__getattr__   s    2t$$r   r   N)r*   r+   r,   r-   r5   r;   r.   __classdictcell____classdict__s   @r   r1   r1      s     	%	% 	%r   r1   c                    V # )z
Decorator for a function that is known to fail when running
strict (``sys.getobjects()``) leakchecks.

This type of leakcheck finds all objects, even those, such as
strings, which are not tracked by the garbage collector.
r   r   s   &r   fails_strict_leakcheckrA      s	     r   c                   ,   a  ] tR t^t o R tR tRtV tR# )!ignores_types_in_strict_leakcheckc                    Wn         R # r   types)r4   rF   s   &&r   __init__*ignores_types_in_strict_leakcheck.__init__   s    
r   c                (    V P                   Vn        V# r   )rF   leakcheck_ignore_types)r4   r   s   &&r   __call__*ignores_types_in_strict_leakcheck.__call__   s    &*jj#r   rE   N)r*   r+   r,   r-   rG   rK   r.   r=   r>   s   @r   rC   rC      s      r   rC   c                   X   a  ] tR t^t o RtRtR tR tR tR t	R t
R tR tR tR	tV tR
# )_RefCountCheckerc                V    Wn         W n        . V n        / V n        RV n        R V n        R# )FNr   )testcasefunctiondeltas
peak_statsignored_typesneeds_setUp)r4   rP   rQ   s   &&&r   rG   _RefCountChecker.__init__   s,       !r   c                   WJ d   R # \        V4      pV\        V P                  4      8X  d1    V P                  P                  V4      pV\
        Jd   V'       d   R # V P                  P                  4        F  pWJ g   K
   R # 	  W P                  9   g,   W P                  9   g   VP                  V P                  9   d   R # R#   \         d"    T P                  P	                  T4      ^ 8H  p Li ; i)FT)type_include_object_p__eq__AttributeError__cmp__NotImplemented__dict__valuesrT   IGNORED_TYPESr*   IGNORED_TYPE_NAMES)r4   objkindexact_method_equalsxs   &&   r   rY   "_RefCountChecker._include_object_p   s    
 ;Cy 4..//O&*&<&<&C&CC&H# #.8=P %%'Ax ( &&&)))}} 7 77 / " O '+&<&<&D&DS&IQ&N#	Os   C )C10C1c                \    \         P                  ! R V P                  V P                  R7      # )N)limitrS   filter)objgraphgrowthrS   rY   r3   s   &r   _growth_RefCountChecker._growth   s$    Tdoo&*&<&<> 	>r   c                    V'       g   R # . p\        R V 4       4      pV F   w  rEpVP                  RW4WV3,          4       K"  	  RP                  V4      pV# )z<Unable to calculate growth>c              3   @   "   T F  w  p p\        V4      x  K  	  R # 5ir   )len).0r:   _s   &  r   	<genexpr>0_RefCountChecker._report_diff.<locals>.<genexpr>   s     7*$1CIIs   z%-*s%9d %+9d
)maxappendjoin)r4   rk   lineswidthr:   countdeltadiffs   &&      r   _report_diff_RefCountChecker._report_diff   sW    1777"(DLL5*EEF #) yyr   c                   \         P                  ! 4       p\         P                  ! 4        V P                  '       d,   V P                  P                  4        R V P                  n         V P                  ! V P                  .VO5/ VB  V P                  P                  4        V P                  P                  4        RV P                  n        RV n        V'       d   \         P                  ! 4        R# R#   T P                  P                  4        T P                  P                  4        RT P                  n        RT n        T'       d   \         P                  ! 4        i i ; i)FTN)r9   	isenableddisablerU   rP   setUpskipTearDownrQ   tearDown
doCleanupsenable)r4   argskwargs
gc_enableds   &&& r   	_run_test_RefCountChecker._run_test   s    \\^



MM!).DMM&	MM$--9$9&9MM""$MM$$&)-DMM&#D		 	 MM""$MM$$&)-DMM&#D		 s   ) C6 6A,E"c                
   R \         P                  9   d&   \         P                  R ,          P                  4        R\         P                  9   d&   \         P                  R,          P                  4        V P                  4       # )urlparsezurllib.parse)r%   modulesclear_cacherl   r3   s   &r   _growth_after_RefCountChecker._growth_after  sR     $KK
#//1S[[(KK'335||~r   c                   V P                   pV'       g   R # \        P                  '       d   \        R\        P                  : 24      hVRR ^ ^ .8X  d   \	        V4      R9   d   R# VRR . R	O8X  d   R# \	        V4      ^8  d   \        VR
R 4      ^ 8X  d   R# \	        V4      ^8  d]   VR,          ^ 8  dO   VR,          VR,          8X  d:   VR,          VR,          8X  d%   V P                  V4      p\        RV: RV: 24      h\        VRR 4      ^ 8:  g-   \        VR
R 4      ^ 8:  g   VR
R P                  ^ 4      ^8  d   ^pM^p\	        V4      V8  d#   \        RV: RV P                  V4      : 24      hR # )Tz Generated uncollectable garbage NFzrefcount increased by ru   )r"   r#   )r   r   r   )rR   r9   garbager)   rp   sumr~   r{   )r4   rk   rR   r}   rh   s   &&   r   _check_deltas_RefCountChecker._check_deltas  s\   
 ::: !UVV "#;1a& S[F%:"#;)#v;!F23K 0A 5v;!r
Q6":3KPVWYPZ^deg^hPh$$V,D 64!PQQ vbc{q Crs$4$9VBC[=N=Nq=QUV=VEEv;% $*$($5$5f$="? @ @
 r   c                T   \        ^4       F  p\        P                  ! 4        K  	  \        V P                  RR4      pV'       d   RV P
                  n        \        V P                  RR	4      V n        V P                  4       p V P                  V4      '       dO   V P                  W4       V P                  4       pV P                  P                  \        R V 4       4      4       Ke   V'       d   \        RV P                  : R24      hR#   \         d    T'       g   h  R# i ; i)
r#   r   FTrJ   c              3   2   "   T F  q^,          x  K  	  R# 5i)r"   Nr   )rq   stats   & r   rs   ,_RefCountChecker.__call__.<locals>.<genexpr>Q  s     'CFDQFs   z	Expected z to leak but it did not.Nr   )ranger9   collectr8   rQ   rP   expect_greenlet_leakrT   rl   r   r   r   rR   rw   r   r)   )r4   r   r   rr   expect_failurerk   s   &&&   r   rK   _RefCountChecker.__call__>  s    qAJJL  !0A5I15DMM.$T]]4LbQ 	_$$V,,t,++-""3'CF'C#DE - $dmm%]^^ 	  	! "	s   D AD D'"D'&D')rR   rQ   rT   rU   rS   rP   Nr   )uop_executor)r*   r+   r,   r-   r`   ra   rG   rY   rl   r~   r   r   r   rK   r.   r=   r>   s   @r   rN   rN      sE     
 M	!(T>
"/b_ _r   rN   c                   a  \        S R R4      '       g   \        '       dQ   \        S RR4      pV'       d:   \        '       g.   \        RS P                  : RV: 2\        P
                  R7       S # \        S 4      V 3R l4       pV# )r   Fr   NzIgnoring leakchecks for z: )filec                    < \        V R R4      '       d   \        P                  ! R4      h\        '       d*   \        SRR4      '       g   \        P                  ! R4      h\	        V S4      ! W4      # )r   Fz$This class ignored during leakchecksr   z(Only running tests that fail leakchecks.)r8   r   SkipTestONLY_FAILING_LEAKCHECKSrN   )r4   r   r   methods   &*,r   wrapperwrap_refcount.<locals>.wrapperc  s^    4+U33##$JKK""76;Le+T+T##$NOOf-d;;r   )r8   SKIP_LEAKCHECKSprintr*   r%   stderrr   )r   reasonr   s   f  r   wrap_refcountr   Y  sl    v)511__!:DA//4:OOVLZZ 
6]< < Nr   )osr%   r9   	functoolsr   r   rj   environgetRUNNING_ON_GITHUB_ACTIONSRUNNING_ON_TRAVISRUNNING_ON_APPVEYORRUNNING_ON_CIRUNNING_ON_MANYLINUXr   r   r   r   r   r   r'   AssertionErrorr)   hasattrobjectr1   rA   rC   rN   r   r   r   r   <module>r      s9  0 
 
 	   B JJNN+;< JJNN8,II0I jjnnZ0 !88%8zz~~&:; &TT"**..9S*T**..)KL **..)KL 	^ 	 3%& %
 )HK, ~_v ~_@r   