관리-도구
편집 파일: threading_checker.cpython-311.pyc
� �܋f� � �z � d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z m Z erd dlmZ G d� de� � Z dd �ZdS )� )�annotations)� TYPE_CHECKING)�nodes)�BaseChecker)�only_required_for_messages� safe_infer)�PyLinterc �^ � e Zd ZdZdZ ed� � ZddiZ ed� � d d�� � Z dS )�ThreadingCheckerz�Checks for threading module. - useless with lock - locking used in wrong way that has no effect (with threading.Lock():) � threading)zthreading.Lockzthreading.RLockzthreading.Conditionzthreading.Semaphorezthreading.BoundedSemaphore�W2101)z/'%s()' directly created in 'with' has no effect�useless-with-lockz�Used when a new lock instance is created by using with statement which has no effect. Instead, an existing instance should be used to acquire lock.r �node� nodes.With�return�Nonec � � d� |j D � � }|D ]h}t |t j � � rLt |j � � }|��3|� � � }|| j v r| � d||�� � �id S )Nc 3 �T K � | ]#\ }}t |t j � � �|V � �$d S �N)� isinstancer �Call)�.0�c�_s �r/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/checkers/threading_checker.py� <genexpr>z.ThreadingChecker.visit_with.<locals>.<genexpr>/ s7 � � � �R�R�$�!�Q� �1�e�j�8Q�8Q�R�A�R�R�R�R�R�R� r )r �args) �itemsr r r r �func�qname�LOCKS�add_message)�selfr �context_managers�context_manager�infered_functionr! s r � visit_withzThreadingChecker.visit_with- s� � �R�R�$�*�R�R�R��/� Q� Q�O��/�5�:�6�6� Q�#-�o�.B�#C�#C� �#�+��(�.�.�0�0���D�J�&�&��$�$�%8�t�%�$�P�P�P�� Q� Qr N)r r r r ) �__name__� __module__�__qualname__�__doc__�name� frozensetr"