From 5f34219df7226f4cd18ef9c46838ef97830032ae Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Mon, 29 Apr 2019 09:04:31 +0200 Subject: [PATCH] A weird __eq__ method could raise an exception when using 'in' --- pysnooper/variables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pysnooper/variables.py b/pysnooper/variables.py index b0486bb..8e5d091 100644 --- a/pysnooper/variables.py +++ b/pysnooper/variables.py @@ -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