F[A
d Z ddlmZ ddlmZmZ ddlZddlmZmZ ddl m
Z
ddlmZ ddl
mZ erdd lmZ G d
de
j ZddZdS )z!Looks for overlapping exceptions. )annotations)
TYPE_CHECKINGAnyN)nodesutil)checkers)utils)_annotated_unpack_infer)PyLinterc V e Zd ZdZdZddiZdZ ej d d
d Z dS )OverlappingExceptionsCheckerzChecks 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-exceptW0714)zOverlapping exceptions (%s)overlapping-exceptz8Used when exceptions in handler overlap or are identical r nodenodes.TryExceptreturnNonec |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 sqd | 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
}kdS ) zCheck for empty except.Nc F g | ]}t |t j |S r
isinstanceastroidClassDef.0ancs z/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pylint/extensions/overlapping_exceptions.py