Make it possible to access properties again

This time we catch all exceptions and try to avoid issues for the user.

This is only happening when working with an Interpreter. I don't feel this is
necessary otherwise.

See #1299
This commit is contained in:
Dave Halter
2019-08-11 11:16:01 +02:00
parent a7accf4171
commit c3d40949b1
6 changed files with 45 additions and 13 deletions

View File

@@ -436,6 +436,7 @@ class Interpreter(Script):
>>> print(script.completions()[0].name)
upper
"""
_allow_descriptor_getattr_default = True
def __init__(self, source, namespaces, **kwds):
"""
@@ -466,6 +467,7 @@ class Interpreter(Script):
super(Interpreter, self).__init__(source, environment=environment,
_project=Project(os.getcwd()), **kwds)
self.namespaces = namespaces
self._evaluator.allow_descriptor_getattr = self._allow_descriptor_getattr_default
def _get_module(self):
return interpreter.MixedModuleContext(