From f32c2e6dc441997932a69309b9a8416be5342d75 Mon Sep 17 00:00:00 2001 From: David Halter Date: Wed, 9 Jan 2013 21:26:50 +0100 Subject: [PATCH] added a common.MultiLevelAttributeError to copying, because there were some problems --- jedi/evaluate.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/jedi/evaluate.py b/jedi/evaluate.py index 1e8a02ab..b1748d84 100644 --- a/jedi/evaluate.py +++ b/jedi/evaluate.py @@ -649,19 +649,22 @@ class Execution(Executable): objects can be used for the executions, as if they were in the execution. """ - # Copy all these lists into this local function. - attr = getattr(self.base, prop) - objects = [] - for element in attr: - if element is None: - copied = element - else: - copied = helpers.fast_parent_copy(element) - copied.parent = self._scope_copy(copied.parent) - if isinstance(copied, parsing.Function): - copied = Function(copied) - objects.append(copied) - return objects + try: + # Copy all these lists into this local function. + attr = getattr(self.base, prop) + objects = [] + for element in attr: + if element is None: + copied = element + else: + copied = helpers.fast_parent_copy(element) + copied.parent = self._scope_copy(copied.parent) + if isinstance(copied, parsing.Function): + copied = Function(copied) + objects.append(copied) + return objects + except AttributeError: + raise common.MultiLevelAttributeError(sys.exc_info()) def __getattr__(self, name): if name not in ['start_pos', 'end_pos', 'imports']: