Skip to content

Commit

Permalink
Merge pull request #23726 from hawkinsp:debug
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 676030839
  • Loading branch information
Google-ML-Automation committed Sep 18, 2024
2 parents 016c499 + c756d9b commit cd04d0f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jax/_src/debugger/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ def from_frameinfo(cls, frame_info) -> DebuggerFrame:
# then we subtract it off from the `lineno` and don't need to subtract 1
# since both start and lineno are 1-indexed.
offset = frame_info.lineno - max(start, 1)
if offset >= len(source):
# Sometimes we don't get a valid source/offset pair. This seems to
# happen sometimes when code uses eval(). If that happens, give up.
source = []
offset = None
except OSError:
source = []
offset = None
Expand Down

0 comments on commit cd04d0f

Please sign in to comment.