Merge pull request #3692 from smacke/null-tb-offset-fix

fix for null tb_offset
This commit is contained in:
Will McGugan 2025-06-24 13:59:41 +01:00 committed by GitHub
commit fa9ce3ce70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -178,7 +178,9 @@ def install(
# determine correct tb_offset
compiled = tb_data.get("running_compiled_code", False)
tb_offset = tb_data.get("tb_offset", 1 if compiled else 0)
tb_offset = tb_data.get("tb_offset")
if tb_offset is None:
tb_offset = 1 if compiled else 0
# remove ipython internal frames from trace with tb_offset
for _ in range(tb_offset):
if tb is None: