From 67a0f604a70d5dfcb879f1f8c7845c80cfb0efcf Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 1 Jul 2016 19:32:05 +0200 Subject: [PATCH] Fix an issue with interpreter exceptions in certain cases. --- jedi/evaluate/compiled/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jedi/evaluate/compiled/__init__.py b/jedi/evaluate/compiled/__init__.py index 7e939a1b..66aca20d 100644 --- a/jedi/evaluate/compiled/__init__.py +++ b/jedi/evaluate/compiled/__init__.py @@ -285,6 +285,11 @@ class LazyNamesDict(object): getattr(self._compiled_obj.obj, name) except AttributeError: raise KeyError('%s in %s not found.' % (name, self._compiled_obj)) + except Exception: + # This is a bit ugly. We're basically returning this to make + # lookups possible without having the actual attribute. However + # this makes proper completion possible. + return [FakeName(name, create(self._evaluator, None), is_definition=True)] return [self.name_class(self._evaluator, self._compiled_obj, name)] def values(self):