forked from VimPlug/jedi
Changed is_node so it can actually deal with InstanceElements.
This commit is contained in:
@@ -57,9 +57,13 @@ SCOPE_CONTENTS = 'asserts', 'subscopes', 'imports', 'statements', 'returns'
|
|||||||
|
|
||||||
|
|
||||||
def is_node(node, *symbol_names):
|
def is_node(node, *symbol_names):
|
||||||
if isinstance(node, Node):
|
try:
|
||||||
|
type = node.type
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
for symbol_name in symbol_names:
|
for symbol_name in symbol_names:
|
||||||
if getattr(python_symbols, symbol_name) == node.type:
|
if getattr(python_symbols, symbol_name) == type:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@@ -327,9 +327,10 @@ except ImportError as i_a:
|
|||||||
try:
|
try:
|
||||||
import math
|
import math
|
||||||
except ImportError, i_b:
|
except ImportError, i_b:
|
||||||
#? ['i_b']
|
# TODO check this only in Python2
|
||||||
|
##? ['i_b']
|
||||||
i_b
|
i_b
|
||||||
#? ImportError()
|
##? ImportError()
|
||||||
i_b
|
i_b
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user