forked from VimPlug/jedi
Use @common.rethrow_uncaught and stop manual re-raise
This commit is contained in:
@@ -581,12 +581,7 @@ def follow_statement(stmt, seek_name=None):
|
|||||||
commands = stmt.get_commands()
|
commands = stmt.get_commands()
|
||||||
debug.dbg('calls: %s' % commands)
|
debug.dbg('calls: %s' % commands)
|
||||||
|
|
||||||
try:
|
|
||||||
result = follow_call_list(commands)
|
result = follow_call_list(commands)
|
||||||
except AttributeError:
|
|
||||||
# This is so evil! But necessary to propagate errors. The attribute
|
|
||||||
# errors here must not be catched, because they shouldn't exist.
|
|
||||||
raise common.MultiLevelAttributeError(sys.exc_info())
|
|
||||||
|
|
||||||
# Assignment checking is only important if the statement defines multiple
|
# Assignment checking is only important if the statement defines multiple
|
||||||
# variables.
|
# variables.
|
||||||
@@ -598,6 +593,7 @@ def follow_statement(stmt, seek_name=None):
|
|||||||
return set(result)
|
return set(result)
|
||||||
|
|
||||||
|
|
||||||
|
@common.rethrow_uncaught
|
||||||
def follow_call_list(call_list, follow_array=False):
|
def follow_call_list(call_list, follow_array=False):
|
||||||
"""
|
"""
|
||||||
`call_list` can be either `pr.Array` or `list of list`.
|
`call_list` can be either `pr.Array` or `list of list`.
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ instantiated. This class represents these cases.
|
|||||||
So, why is there also a ``Class`` class here? Well, there are decorators and
|
So, why is there also a ``Class`` class here? Well, there are decorators and
|
||||||
they change classes in Python 3.
|
they change classes in Python 3.
|
||||||
"""
|
"""
|
||||||
import sys
|
|
||||||
import copy
|
import copy
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
@@ -668,6 +667,7 @@ class Execution(Executable):
|
|||||||
"""
|
"""
|
||||||
return self.get_params() + pr.Scope.get_set_vars(self)
|
return self.get_params() + pr.Scope.get_set_vars(self)
|
||||||
|
|
||||||
|
@common.rethrow_uncaught
|
||||||
def copy_properties(self, prop):
|
def copy_properties(self, prop):
|
||||||
"""
|
"""
|
||||||
Literally copies a property of a Function. Copying is very expensive,
|
Literally copies a property of a Function. Copying is very expensive,
|
||||||
@@ -675,7 +675,6 @@ class Execution(Executable):
|
|||||||
objects can be used for the executions, as if they were in the
|
objects can be used for the executions, as if they were in the
|
||||||
execution.
|
execution.
|
||||||
"""
|
"""
|
||||||
try:
|
|
||||||
# Copy all these lists into this local function.
|
# Copy all these lists into this local function.
|
||||||
attr = getattr(self.base, prop)
|
attr = getattr(self.base, prop)
|
||||||
objects = []
|
objects = []
|
||||||
@@ -689,8 +688,6 @@ class Execution(Executable):
|
|||||||
copied = Function(copied)
|
copied = Function(copied)
|
||||||
objects.append(copied)
|
objects.append(copied)
|
||||||
return objects
|
return objects
|
||||||
except AttributeError:
|
|
||||||
raise common.MultiLevelAttributeError(sys.exc_info())
|
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
if name not in ['start_pos', 'end_pos', 'imports', '_sub_module']:
|
if name not in ['start_pos', 'end_pos', 'imports', '_sub_module']:
|
||||||
@@ -698,8 +695,8 @@ class Execution(Executable):
|
|||||||
return getattr(self.base, name)
|
return getattr(self.base, name)
|
||||||
|
|
||||||
@cache.memoize_default()
|
@cache.memoize_default()
|
||||||
|
@common.rethrow_uncaught
|
||||||
def _scope_copy(self, scope):
|
def _scope_copy(self, scope):
|
||||||
try:
|
|
||||||
""" Copies a scope (e.g. if) in an execution """
|
""" Copies a scope (e.g. if) in an execution """
|
||||||
# TODO method uses different scopes than the subscopes property.
|
# TODO method uses different scopes than the subscopes property.
|
||||||
|
|
||||||
@@ -711,8 +708,6 @@ class Execution(Executable):
|
|||||||
copied = helpers.fast_parent_copy(scope)
|
copied = helpers.fast_parent_copy(scope)
|
||||||
copied.parent = self._scope_copy(copied.parent)
|
copied.parent = self._scope_copy(copied.parent)
|
||||||
return copied
|
return copied
|
||||||
except AttributeError:
|
|
||||||
raise common.MultiLevelAttributeError(sys.exc_info())
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@cache.memoize_default()
|
@cache.memoize_default()
|
||||||
|
|||||||
Reference in New Issue
Block a user