mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-21 11:27:38 +03:00
Use isinstance() for type checking
This commit is contained in:
parent
6c9139e395
commit
6429cae932
@ -104,7 +104,7 @@ class EDMCContextFilter(logging.Filter):
|
||||
# of the frames internal to logging.
|
||||
frame = sys._getframe(0)
|
||||
while frame:
|
||||
if type(frame.f_locals.get('self')) == logging.Logger:
|
||||
if isinstance(frame.f_locals.get('self'), logging.Logger):
|
||||
frame = frame.f_back # Want to start on the next frame below
|
||||
break
|
||||
frame = frame.f_back
|
||||
@ -113,7 +113,7 @@ class EDMCContextFilter(logging.Filter):
|
||||
# that is *not* true, as it should be the call site of the logger
|
||||
# call
|
||||
while frame:
|
||||
if type(frame.f_locals.get('self')) != logging.Logger:
|
||||
if not isinstance(frame.f_locals.get('self'), logging.Logger):
|
||||
break # We've found the frame we want
|
||||
frame = frame.f_back
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user