Skip to content

Commit

Permalink
cutting trace size
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Nov 26, 2023
1 parent ac9db1f commit ae851cc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions instld/cli/traceback_cutting/traceback_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ def cut_base_of_traceback(traceback_object, base_size):


def cut_importlib_bug(traceback_object):
while traceback_object is not None:
if not (traceback_object.tb_frame.f_code.co_qualname == '_call_with_frames_removed' and traceback_object.tb_frame.f_code.co_filename == '<frozen importlib._bootstrap>'):
return traceback_object
traceback_object = traceback_object.tb_next
try:
while traceback_object is not None:
if not (traceback_object.tb_frame.f_code.co_qualname == '_call_with_frames_removed' and traceback_object.tb_frame.f_code.co_filename == '<frozen importlib._bootstrap>'):
return traceback_object
traceback_object = traceback_object.tb_next
except AttributeError:
return traceback_object

0 comments on commit ae851cc

Please sign in to comment.