Resolve "Unhandled exception in event loop when axis are disabled"
Closes #4115 (closed)
Prevent execution of code from the typing helper, when checking if a property is callable.
At the same time it fixes the "unhandled exception" seen in #4115 (closed) in case executing the property was producing an exception.
The proposed fix leverages safe_getattr
from jedi
:
>>> from jedi.inference.compiled.access import safe_getattr
>>> class A:
... @property
... def x(self):
... print("oops")
...
>>> a=A()
>>> safe_getattr(a, "x")
<property object at 0x7f527177c860>
>>> hasattr(a, "x")
oops
True
Edited by Matias Guijarro