forked from VimPlug/jedi
fixed for loop in exception issue combined with usage of an exception variable
This commit is contained in:
@@ -274,8 +274,9 @@ class NameFinder(object):
|
||||
|
||||
# check for `except X as y` usages, because y needs to be instantiated.
|
||||
p = stmt.parent
|
||||
# TODO this looks really hacky, improve parser representation!
|
||||
if isinstance(p, pr.Flow) and p.command == 'except' \
|
||||
and p.get_defined_names(is_internal_call=True) == [name]:
|
||||
and p.inputs and p.inputs[0].as_names == [name]:
|
||||
# TODO check for types that are not classes and add it to the
|
||||
# static analysis report.
|
||||
types = list(chain.from_iterable(
|
||||
|
||||
@@ -342,6 +342,10 @@ try:
|
||||
except MyException as e:
|
||||
#? ['my_attr']
|
||||
e.my_attr
|
||||
#? 22 ['my_attr']
|
||||
for x in e.my_attr:
|
||||
pass
|
||||
|
||||
|
||||
# -----------------
|
||||
# continuations
|
||||
|
||||
Reference in New Issue
Block a user