Skip to content

Commit 19d58f7

Browse files
committed
Tune friendly traceback
Always print the line contents as it just too confusing without it.
1 parent 7947986 commit 19d58f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/runtime.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ def user_friendly_traceback(exception_s: type[BaseException] | tuple[type[BaseEx
5959
found_culprit = False
6060
for frame in reversed(traceback.extract_tb(tb)):
6161
relative_filename = frame.filename.split(GITSAVVY__)[-1]
62-
print(f"| {relative_filename}:{frame.lineno}")
6362
if not found_culprit and relative_filename.startswith(CORE_COMMANDS__):
6463
found_culprit = True
65-
print(f"|> {frame.line}")
64+
left_column = f"|> {relative_filename}:{frame.lineno}"
65+
else:
66+
left_column = f"| {relative_filename}:{frame.lineno}"
67+
print(f"{left_column:<40} {frame.line}")
6668

6769

6870
def it_runs_on_ui():

0 commit comments

Comments
 (0)