Skip to content

Commit a6ec9d6

Browse files
author
Philip Guo
committed
ignore __repr__ calls too
1 parent 1026ae1 commit a6ec9d6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎v3/pg_logger.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,16 @@ def interaction(self, frame, traceback, event_type):
323323
# also don't trace inside of the magic "constructor" code
324324
if cur_frame.f_code.co_name == '__new__':
325325
return
326+
# or __repr__, which is often called when running print statements
327+
if cur_frame.f_code.co_name == '__repr__':
328+
return
329+
330+
331+
# debug ...
332+
#print('===', file=sys.stderr)
333+
#for (e,ln) in self.stack:
334+
# print(e.f_code.co_name + ' ' + e.f_code.co_filename + ' ' + str(ln), file=sys.stderr)
335+
#print('', file=sys.stderr)
326336

327337

328338
# don't trace inside of our __restricted_import__ helper function

0 commit comments

Comments
 (0)