mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-10 07:41:51 +08:00
removed a hasattr(), because in python 2 it catches also other exceptions
This commit is contained in:
@@ -400,9 +400,9 @@ class Execution(Executable):
|
|||||||
else:
|
else:
|
||||||
# Don't do this with exceptions, as usual, because some deeper
|
# Don't do this with exceptions, as usual, because some deeper
|
||||||
# exceptions could be catched - and I wouldn't know what happened.
|
# exceptions could be catched - and I wouldn't know what happened.
|
||||||
if hasattr(self.base, 'returns'):
|
try:
|
||||||
stmts = self._get_function_returns(evaluate_generator)
|
self.base.returns
|
||||||
else:
|
except (AttributeError, DecoratorNotFound):
|
||||||
try:
|
try:
|
||||||
# If it is an instance, we try to execute the __call__().
|
# If it is an instance, we try to execute the __call__().
|
||||||
call_method = self.base.get_subscope_by_name('__call__')
|
call_method = self.base.get_subscope_by_name('__call__')
|
||||||
@@ -416,6 +416,8 @@ class Execution(Executable):
|
|||||||
call_method = InstanceElement(base, call_method)
|
call_method = InstanceElement(base, call_method)
|
||||||
exe = Execution(call_method, self.var_args)
|
exe = Execution(call_method, self.var_args)
|
||||||
stmts = exe.get_return_types()
|
stmts = exe.get_return_types()
|
||||||
|
else:
|
||||||
|
stmts = self._get_function_returns(evaluate_generator)
|
||||||
|
|
||||||
debug.dbg('exec result: %s in %s' % (stmts, self))
|
debug.dbg('exec result: %s in %s' % (stmts, self))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user