관리-도구
편집 파일: overlapping_exceptions.cpython-311.pyc
� �܋f � � � d Z ddlmZ ddlmZmZ ddlZddlmZmZ ddl m Z ddlmZ ddl mZ erdd lmZ G d � de j � � Zdd�ZdS )z!Looks for overlapping exceptions.� )�annotations)� TYPE_CHECKING�AnyN)�nodes�util)�checkers)�utils)�_annotated_unpack_infer)�PyLinterc �V � e Zd ZdZdZddiZdZ ej d� � d d�� � Z dS )�OverlappingExceptionsCheckerz�Checks for two or more exceptions in the same exception handler clause that are identical or parts of the same inheritance hierarchy. (i.e. overlapping). zoverlap-except�W0714)zOverlapping exceptions (%s)�overlapping-exceptz8Used when exceptions in handler overlap or are identical� r �node�nodes.TryExcept�return�Nonec � � |j D �]�}|j ��t |j t j � � r�+ t t |j � � � � }n# t j $ r Y �_w xY wg }|D �]i\ }}t |t j � � r�!t |t j � � rt j |� � r|j }t |t j � � s�qd� |� � � D � � }|D ]�\ }} d� | � � � D � � } || k rH| � d|j |� � � � d|� � � � d��� � �q| |v s|| v rV|| v r|n|}| |v r|n|}| � d|j |� � � � d|� � � � ��� � ��|||fgz }��k���dS ) zCheck for empty except.Nc �F � g | ]}t |t j � � �|��S r �� isinstance�astroid�ClassDef��.0�ancs �y/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/extensions/overlapping_exceptions.py� <listcomp>z@OverlappingExceptionsChecker.visit_tryexcept.<locals>.<listcomp>>