Skip to content

Commit a34914b

Browse files
committed
fix for null tb_offset
1 parent 0c6c756 commit a34914b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rich/traceback.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ def ipy_display_traceback(
177177

178178
# determine correct tb_offset
179179
compiled = tb_data.get("running_compiled_code", False)
180-
tb_offset = tb_data.get("tb_offset", 1 if compiled else 0)
180+
tb_offset = tb_data.get("tb_offset")
181+
if tb_offset is None:
182+
tb_offset = 1 if compiled else 0
181183
# remove ipython internal frames from trace with tb_offset
182184
for _ in range(tb_offset):
183185
if tb is None:

0 commit comments

Comments
 (0)