1
0
forked from VimPlug/jedi

fixed for loop in exception issue combined with usage of an exception variable

This commit is contained in:
Dave Halter
2014-06-22 23:32:07 +02:00
parent 401914e91c
commit e106e4ffc8
2 changed files with 6 additions and 1 deletions

View File

@@ -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(

View File

@@ -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