Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problem with lineno being none when generating traceback #1750

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading