1
0
forked from VimPlug/jedi

Get rid of is_super_class and do some different things in analysis

This commit is contained in:
Dave Halter
2018-11-24 14:09:14 +01:00
parent 021d1bc568
commit 644e292fa7
4 changed files with 8 additions and 12 deletions

View File

@@ -5,7 +5,6 @@ from parso.python import tree
from jedi._compatibility import force_unicode
from jedi import debug
from jedi.evaluate.compiled import CompiledObject
from jedi.evaluate.helpers import is_string
@@ -145,11 +144,15 @@ def _check_for_exception_catch(node_context, jedi_name, exception, payload=None)
Returns True if the exception was catched.
"""
def check_match(cls, exception):
try:
return isinstance(cls, CompiledObject) and cls.is_super_class(exception)
except TypeError:
if not cls.is_class():
return False
for python_cls in exception.mro():
if cls.py__name__() == python_cls.__name__ \
and cls.parent_context == cls.evaluator.builtins_module:
return True
return False
def check_try_for_except(obj, exception):
# Only nodes in try
iterator = iter(obj.children)