1
0
forked from VimPlug/jedi

Make it possible to access functions that were inherited, see #1347

This commit is contained in:
Dave Halter
2019-08-11 20:32:22 +02:00
parent 1ad4003740
commit f727e4e661

View File

@@ -84,9 +84,14 @@ def safe_getattr(obj, name, default=_sentinel):
raise
return default
else:
if type(attr) in ALLOWED_DESCRIPTOR_ACCESS:
if isinstance(attr, ALLOWED_DESCRIPTOR_ACCESS):
# In case of descriptors that have get methods we cannot return
# it's value, because that would mean code execution.
# Since it's an isinstance call, code execution is still possible,
# but this is not really a security feature, but much more of a
# safety feature. Code execution is basically always possible when
# a module is imported. This is here so people don't shoot
# themselves in the foot.
return getattr(obj, name)
return attr