1
0
forked from VimPlug/jedi

Properly handle no __getitem__ on CompiledObject

This commit is contained in:
Dave Halter
2018-12-20 00:34:15 +01:00
parent fcda62862c
commit fcda3f7bc5
3 changed files with 22 additions and 3 deletions

View File

@@ -233,6 +233,9 @@ class DirectObjectAccess(object):
return self._create_access_path(self._obj[index])
def py__iter__list(self):
if not hasattr(self._obj, '__getitem__'):
return None
if type(self._obj) not in (str, list, tuple, unicode, bytes, bytearray, dict):
# Get rid of side effects, we won't call custom `__getitem__`s.
return []