diff --git a/notes-and-examples/2026.07.01/red_black_tree.py b/notes-and-examples/2026.07.01/red_black_tree.py index 8df2bcd..bb74a9e 100644 --- a/notes-and-examples/2026.07.01/red_black_tree.py +++ b/notes-and-examples/2026.07.01/red_black_tree.py @@ -1,3 +1,5 @@ +import traceback + class Node: def __init__(self, value, left=None, right=None, parent=None, is_red=False): self.value = value @@ -451,8 +453,10 @@ def run_tests(): print(" Your rebalance likely created a cycle or otherwise broke the") print(" tree structure (a child pointing back up at an ancestor).\n") continue - except Exception as e: - print(f" RESULT: ERROR - {type(e).__name__}: {e}\n") + except Exception: + print(f" RESULT: ERROR - see stack trace below\n") + print(traceback.format_exc()) + print("") continue # Guard the author (you) against a typo when adding a new case: the