Skip to content

Commit fa9ce3c

Browse files
authored
Merge pull request #3692 from smacke/null-tb-offset-fix
fix for null tb_offset
2 parents e0c7e96 + a34914b commit fa9ce3c

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
@@ -178,7 +178,9 @@ def ipy_display_traceback(
178178

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

0 commit comments

Comments
 (0)