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):
|
||||
new = set()
|
||||
for stmt in stmts:
|
||||
if isinstance(stmt, pr.Scope):
|
||||
new |= add_stmts(stmt.inputs)
|
||||
if isinstance(stmt, pr.Flow):
|
||||
while stmt is not None:
|
||||
new |= add_stmts(stmt.inputs)
|
||||
stmt = stmt.next
|
||||
continue
|
||||
if isinstance(stmt, pr.KeywordStatement):
|
||||
stmt = stmt.stmt
|
||||
|
||||
@@ -50,6 +50,13 @@ try:
|
||||
str.not_existing
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user