Skip to content

Commit 06c47a3

Browse files
Remove dead code left after gh-110721 (#111905)
1 parent 148af38 commit 06c47a3

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

Python/traceback.c

-37
Original file line numberDiff line numberDiff line change
@@ -618,44 +618,7 @@ tb_displayline(PyTracebackObject* tb, PyObject *f, PyObject *filename, int linen
618618
if (rc != 0 || !source_line) {
619619
/* ignore errors since we can't report them, can we? */
620620
err = ignore_source_errors();
621-
goto done;
622621
}
623-
624-
int code_offset = tb->tb_lasti;
625-
PyCodeObject* code = _PyFrame_GetCode(frame->f_frame);
626-
const Py_ssize_t source_line_len = PyUnicode_GET_LENGTH(source_line);
627-
628-
int start_line;
629-
int end_line;
630-
int start_col_byte_offset;
631-
int end_col_byte_offset;
632-
if (!PyCode_Addr2Location(code, code_offset, &start_line, &start_col_byte_offset,
633-
&end_line, &end_col_byte_offset)) {
634-
goto done;
635-
}
636-
637-
if (start_line < 0 || end_line < 0
638-
|| start_col_byte_offset < 0
639-
|| end_col_byte_offset < 0)
640-
{
641-
goto done;
642-
}
643-
644-
// If this is a multi-line expression, then we will highlight until
645-
// the last non-whitespace character.
646-
const char *source_line_str = PyUnicode_AsUTF8(source_line);
647-
if (!source_line_str) {
648-
goto done;
649-
}
650-
651-
Py_ssize_t i = source_line_len;
652-
while (--i >= 0) {
653-
if (!IS_WHITESPACE(source_line_str[i])) {
654-
break;
655-
}
656-
}
657-
658-
done:
659622
Py_XDECREF(source_line);
660623
return err;
661624
}

0 commit comments

Comments
 (0)