Skip to content

Commit 7f749e2

Browse files
authored
Merge pull request #40 from jhermann/patch-1
Fix value vs object identity error (closes #39)
2 parents c694c2d + 05c7a8f commit 7f749e2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

json_logging/util.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,8 @@ def get_request_from_call_stack(self):
184184
return f_locals['req']
185185

186186
for key in f_locals:
187-
if key is not 'request' and key is not 'req':
188-
if isinstance(f_locals[key], class_type):
189-
return f_locals[key]
187+
if key not in {'request', 'req'} and isinstance(f_locals[key], class_type):
188+
return f_locals[key]
190189
if f.f_back is not None:
191190
f = f.f_back
192191
else:

0 commit comments

Comments
 (0)