forked from VimPlug/jedi
jedi should be able to detect exceptions even in except X: statements
This commit is contained in:
@@ -147,8 +147,10 @@ def get_module_statements(module):
|
|||||||
def add_stmts(stmts):
|
def add_stmts(stmts):
|
||||||
new = set()
|
new = set()
|
||||||
for stmt in stmts:
|
for stmt in stmts:
|
||||||
if isinstance(stmt, pr.Scope):
|
if isinstance(stmt, pr.Flow):
|
||||||
|
while stmt is not None:
|
||||||
new |= add_stmts(stmt.inputs)
|
new |= add_stmts(stmt.inputs)
|
||||||
|
stmt = stmt.next
|
||||||
continue
|
continue
|
||||||
if isinstance(stmt, pr.KeywordStatement):
|
if isinstance(stmt, pr.KeywordStatement):
|
||||||
stmt = stmt.stmt
|
stmt = stmt.stmt
|
||||||
|
|||||||
@@ -50,6 +50,13 @@ try:
|
|||||||
str.not_existing
|
str.not_existing
|
||||||
except [AttributeError]: pass
|
except [AttributeError]: pass
|
||||||
|
|
||||||
|
# Should be able to detect errors in except statement as well.
|
||||||
|
try:
|
||||||
|
pass
|
||||||
|
#! 7 name-error
|
||||||
|
except Undefined:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# kind of similar: hasattr
|
# kind of similar: hasattr
|
||||||
|
|||||||
Reference in New Issue
Block a user