A weird __eq__ method could raise an exception when using 'in'

This commit is contained in:
Alex Hall
2019-04-29 09:04:31 +02:00
committed by Ram Rachum
parent e1bdbc0042
commit 5f34219df7

View File

@@ -26,9 +26,9 @@ class CommonVariable(BaseVariable):
def _items(self, main_value):
result = [(self.source, get_shortish_repr(main_value))]
for key in self._safe_keys(main_value):
if key in self.exclude:
continue
try:
if key in self.exclude:
continue
value = self._get_value(main_value, key)
except Exception:
continue