From 99427aa1d72d5ae67f45ee46ede419033951dacb Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Wed, 11 Oct 2023 11:45:40 -0500 Subject: [PATCH] reduced symbolic traceback depth for performance reasons --- src/uberjob/_util/traceback.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/uberjob/_util/traceback.py b/src/uberjob/_util/traceback.py index 3957f55..c342665 100644 --- a/src/uberjob/_util/traceback.py +++ b/src/uberjob/_util/traceback.py @@ -56,7 +56,7 @@ def __repr__(self): TruncatedStackFrame = TruncatedStackFrameType() -MAX_TRACEBACK_DEPTH = 15 +MAX_TRACEBACK_DEPTH = 3 def get_stack_frame(initial_depth=2): @@ -73,9 +73,8 @@ def recurse(frame, depth): ) initial_frame = inspect.currentframe() - while initial_depth: + for _ in range(initial_depth): initial_frame = initial_frame.f_back - initial_depth -= 1 return recurse(initial_frame, MAX_TRACEBACK_DEPTH)