관리-도구
편집 파일: method_args.cpython-311.pyc
� �܋f� � � � d Z ddlmZ ddlmZ ddlZddlmZmZmZ ddl m Z mZ ddlm Z erddlmZ G d � d e � � Zdd�ZdS )z#Variables checkers for Python code.� )�annotations)� TYPE_CHECKINGN)� arguments�bases�nodes)�BaseChecker�utils)� INFERENCE)�PyLinterc � � e Zd ZdZdZddddddifd �Zd ddd dd�ffZ ej dd� � dd�� � Z dd�Z dd�ZdS )�MethodArgsCheckerzpBaseChecker for method_args. Checks for * missing-timeout * positional-only-arguments-expected �method_args)zTMissing timeout argument for method '%s' can cause your program to hang indefinitely�missing-timeoutz�Used when a method needs a 'timeout' parameter in order to avoid waiting for a long time. If no timeout is specified explicitly the default value is used. For example for 'requests' the program will never time out (i.e. hang indefinitely).zI`%s()` got some positional-only arguments passed as keyword arguments: %s�"positional-only-arguments-expectedz�Emitted when positional-only arguments have been passed as keyword arguments. Remove the keywords for the affected arguments in the function call.� minversion)� � )�W3101�E3102ztimeout-methods)zrequests.api.deletezrequests.api.getzrequests.api.headzrequests.api.optionszrequests.api.patchzrequests.api.postzrequests.api.putzrequests.api.request�csvz<comma separated list>zzList of qualified names (i.e., library.method) which require a timeout parameter e.g. 'requests.api.get,requests.api.post')�default�type�metavar�helpr �node� nodes.Call�return�Nonec �Z � | � |� � | � |� � d S �N)�_check_missing_timeout�)_check_positional_only_arguments_expected)�selfr s �l/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/checkers/method_args.py� visit_callzMethodArgsChecker.visit_callE s2 � � �#�#�D�)�)�)��6�6�t�<�<�<�<�<� c �, � t j |j � � }t j � |� � }|r�|� � � s�t |t j t j t j f� � r�|� � � | j j j v rmd� |j D � � }|� |j � � d|vr@| � d||j � � � ft, �� � dS dS dS dS dS dS )z�Check if the call needs a timeout parameter based on package.func_name configured in config.timeout_methods. Package uses inferred node in order to know the package imported. c � � g | ] }|j �� S � ��arg)�.0�keywords r$ � <listcomp>z<MethodArgsChecker._check_missing_timeout.<locals>.<listcomp>\ s � � J� J� J���� J� J� Jr&