mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
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):
|
||||
if isinstance(node, Node):
|
||||
try:
|
||||
type = node.type
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
for symbol_name in symbol_names:
|
||||
if getattr(python_symbols, symbol_name) == node.type:
|
||||
if getattr(python_symbols, symbol_name) == type:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@@ -327,9 +327,10 @@ except ImportError as i_a:
|
||||
try:
|
||||
import math
|
||||
except ImportError, i_b:
|
||||
#? ['i_b']
|
||||
# TODO check this only in Python2
|
||||
##? ['i_b']
|
||||
i_b
|
||||
#? ImportError()
|
||||
##? ImportError()
|
||||
i_b
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user