Properly handle no __getitem__ on CompiledObject

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

No files matched your search

+3
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 []