HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/greenlet/tests/__pycache__/test_gc.cpython-310.pyc
o

���gk�@sNddlZddlZddlZddlmZddlmZejsJ�Gdd�de�ZdS)�N�)�TestCase)�fails_leakcheckc@s0eZdZdd�Zdd�Zdd�Zedd��Zd	S)
�GCTestscCsbt�t�tj����}t��|�dur!ddl}td|�	|���|�
|��|�tjtj�dS)NrzO IS NOT NONE.)
�weakref�ref�greenlet�
getcurrent�switch�gc�collect�sys�print�getrefcount�assertIsNone�assertFalse�garbage)�self�or
�r�A/usr/local/lib/python3.10/dist-packages/greenlet/tests/test_gc.py�test_dead_circular_refs
zGCTests.test_dead_circular_refcCsPGdd�dtj�}|�}||_t�|�}t��|�|��|�tjtj�dS)Nc@seZdZdZdS)z9GCTests.test_circular_greenlet.<locals>.circular_greenletN)�__name__�
__module__�__qualname__rrrrr�circular_greenletsr)	rrrrrrrrr)rrrrrr�test_circular_greenlets
zGCTests.test_circular_greenletcCsJGdd�dtj�}|�}t�|�}t��|�|��|�tjtj�dS)Nc@seZdZdd�Zdd�ZdS)z4GCTests.test_inactive_ref.<locals>.inactive_greenletcSstjj||jd�dS)N)�run)r�__init__r�rrrrr$sz=GCTests.test_inactive_ref.<locals>.inactive_greenlet.__init__cS�dS�Nrrrrrr'�z8GCTests.test_inactive_ref.<locals>.inactive_greenlet.runN)rrrrrrrrr�inactive_greenlet#sr#)rrrrrrrr)rr#rrrr�test_inactive_ref"s
zGCTests.test_inactive_refcsdGdd�dt��g}t�����fdd�}t�|�}||_|�|�|��~~t��t��dS)Nc@seZdZdd�ZdS)z;GCTests.test_finalizer_crash.<locals>.object_with_finalizercSr r!rrrrr�__del__Cr"zCGCTests.test_finalizer_crash.<locals>.object_with_finalizer.__del__N)rrrr%rrrr�object_with_finalizerBsr&cs^��t��_z#z���Wntjytd�YnwWt��`dSWt��`dSt��`w)NzGot greenlet exit!)rr	�objectr
�GreenletExitrr�r&�parentrr�
greenlet_bodyGs���z3GCTests.test_finalizer_crash.<locals>.greenlet_body)r'rr	�array�appendr
rr)rr,r+�grr)r�test_finalizer_crash/s

zGCTests.test_finalizer_crashN)rrrrrr$rr/rrrrrs	

r)	rrr�r�	leakcheckr�GREENLET_USE_GCrrrrr�<module>s