Skip to content
Snippets Groups Projects
Unverified Commit 72ad8188 authored by Claudiu Popa's avatar Claudiu Popa
Browse files

Don't emit catching-non-exception when a tuple component has unknown bases

Close #1756
parent ff33b83c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -305,7 +305,8 @@ class ExceptionsChecker(checkers.BaseChecker):
if any(node is astroid.YES for node in inferred):
# Don't emit if we don't know every component.
return
if all(node and utils.inherit_from_std_ex(node)
if all(node and (utils.inherit_from_std_ex(node) or
not utils.has_known_bases(node))
for node in inferred):
return
 
Loading
Loading
Loading
Loading
@@ -121,3 +121,15 @@ try:
raise Second
except Second:
pass
class SomeBase(UnknownError):
pass
EXCEPTIONS = (SomeBase, ValueError)
try:
raise ValueError
except EXCEPTIONS:
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment