-_=r6G d Z ddlmZ ddlZddlmZ ddlmZ ddlZddlm Z ddl
mZ ddlm
Z
dd lmZ dd
lmZ ddlmZ dd
hZ ed ZdZd dZd!dZd"dZd#dZ G d de ZdS )$z+Basic Error checker from the basic checker. )annotationsN)Iterator)Any)nodes)InferenceResult)utils)
_BasicChecker) infer_all)HIGHz_py_abc.ABCMetazabc.ABCMeta)
__module__ztyping.ForwardRef
break_nodenodes.Breakreturnnodes.For | nodes.While | Nonec t j t j f}| j }t || r| t |dg v r/|} |j }|n#t || | t |dg v /|S )zReturns the loop node that holds the break node in arguments.
Args:
break_node (astroid.Break): the break node of interest.
Returns:
astroid.For or astroid.While: the loop node holding the break node.
orelse)r ForWhileparent
isinstancegetattr)r
loop_nodesr s z/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pylint/checkers/base/basic_error_checker.py_get_break_loop_noder s )U[)J
F,,
g"? ? 1 1
>
,,
g"? ? 1 1 M loopnodes.For | nodes.Whileboolc t j t j f}t j t j f} fd || D t
fd t j | D S )zReturns true if a loop may end with a break statement.
Args:
loop (astroid.For, astroid.While): the loop node inspected.
Returns:
bool: True if the loop may end with a break statement, False otherwise.
c g | ]
}|k |S r! ).0_noder s r