관리-도구
편집 파일: leakcheck.cpython-38.pyc
U �g�. � @ s d dl mZ d dlZd dlZd dlZd dlmZ d dlZd dlZej � d�Zej � d�pZeZej � d�Z epne Zej � d�Zep�ej � d�Zej � d �Zej � d �Zdd� Zd d� ZG dd� de�Zeed�r�G dd� de�Ze� e_eZndd� ZG dd� de�ZG dd� de�Zdd� ZdS )� )�print_functionN)�wrapsZGITHUB_ACTIONSZTRAVISZAPPVEYORZGREENLET_MANYLINUXZGREENLET_SKIP_LEAKCHECKSZ GREENLET_SKIP_FAILING_LEAKCHECKSZ GREENLET_ONLY_FAILING_LEAKCHECKSc C s d| _ | S )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��func� r �H/opt/hc_python/lib64/python3.8/site-packages/greenlet/tests/leakcheck.py�ignores_leakcheckL s r c C s d| _ trt�d�| �} | S )z2 Mark that the function is known to leak. TzSkipping known failures)�fails_leakcheck�SKIP_FAILING_LEAKCHECKS�unittest�skipr r r r r [ s r c @ s e Zd ZdS )�LeakCheckErrorN)�__name__� __module__�__qualname__r r r r r d s r � getobjectsc @ s e Zd Zdd� Zdd� ZdS )�_MockGCc C s t �d�S )Nr )�sysr ��selfr r r �get_objectsl s z_MockGC.get_objectsc C s t t|�S �N)�getattr�gc)r �namer r r �__getattr__n s z_MockGC.__getattr__N)r r r r r r r r r r k s r c C s | S )a 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 r r r �fails_strict_leakchecks s r c @ s e Zd Zdd� Zdd� ZdS )�!ignores_types_in_strict_leakcheckc C s || _ d S r )�types)r r r r r �__init__~ s z*ignores_types_in_strict_leakcheck.__init__c C s | j |_|S r )r �leakcheck_ignore_types)r r r r r �__call__� s z*ignores_types_in_strict_leakcheck.__call__N)r r r r r"