Skip to content

Commit

Permalink
Fix problem with lineno being none when generating traceback
Browse files Browse the repository at this point in the history
Fixes #1745
  • Loading branch information
rchiodo authored Dec 2, 2024
1 parent f4ba976 commit 2809b92
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1523,12 +1523,13 @@ def build_exception_info_response(dbg, thread_id, thread, request_seq, set_addit
if IS_PY311_OR_GREATER:
stack_summary = traceback.StackSummary()
for filename_in_utf8, lineno, method_name, line_text, line_col_info in frames[-max_frames:]:
frame_summary = traceback.FrameSummary(filename_in_utf8, lineno, method_name, line=line_text)
if line_col_info is not None:
frame_summary.end_lineno = line_col_info.end_lineno
frame_summary.colno = line_col_info.colno
frame_summary.end_colno = line_col_info.end_colno
stack_summary.append(frame_summary)
if lineno is not None:
frame_summary = traceback.FrameSummary(filename_in_utf8, lineno, method_name, line=line_text)
if line_col_info is not None and line_col_info.end_lineno is not None:
frame_summary.end_lineno = line_col_info.end_lineno
frame_summary.colno = line_col_info.colno
frame_summary.end_colno = line_col_info.end_colno
stack_summary.append(frame_summary)

stack_str = "".join(stack_summary.format())

Expand Down

0 comments on commit 2809b92

Please sign in to comment.