summaryrefslogtreecommitdiffstats
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-11-10 22:30:01 (GMT)
committerGitHub <noreply@github.com>2023-11-10 22:30:01 (GMT)
commit06c47a305d8f7f4f56a1113d9eb2eddcc175f2ed (patch)
tree292682618072fc5c06e3287ca2327eef57eae5fc /Python/traceback.c
parent148af38cd0adc1c2dde3c937ebbda4ee60b27b33 (diff)
downloadcpython-06c47a305d8f7f4f56a1113d9eb2eddcc175f2ed.zip
cpython-06c47a305d8f7f4f56a1113d9eb2eddcc175f2ed.tar.gz
cpython-06c47a305d8f7f4f56a1113d9eb2eddcc175f2ed.tar.bz2
Remove dead code left after gh-110721 (#111905)
Diffstat (limited to 'Python/traceback.c')
-rw-r--r--Python/traceback.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index 97a77e9..abd429a 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -618,44 +618,7 @@ tb_displayline(PyTracebackObject* tb, PyObject *f, PyObject *filename, int linen
if (rc != 0 || !source_line) {
/* ignore errors since we can't report them, can we? */
err = ignore_source_errors();
- goto done;
}
-
- int code_offset = tb->tb_lasti;
- PyCodeObject* code = _PyFrame_GetCode(frame->f_frame);
- const Py_ssize_t source_line_len = PyUnicode_GET_LENGTH(source_line);
-
- int start_line;
- int end_line;
- int start_col_byte_offset;
- int end_col_byte_offset;
- if (!PyCode_Addr2Location(code, code_offset, &start_line, &start_col_byte_offset,
- &end_line, &end_col_byte_offset)) {
- goto done;
- }
-
- if (start_line < 0 || end_line < 0
- || start_col_byte_offset < 0
- || end_col_byte_offset < 0)
- {
- goto done;
- }
-
- // If this is a multi-line expression, then we will highlight until
- // the last non-whitespace character.
- const char *source_line_str = PyUnicode_AsUTF8(source_line);
- if (!source_line_str) {
- goto done;
- }
-
- Py_ssize_t i = source_line_len;
- while (--i >= 0) {
- if (!IS_WHITESPACE(source_line_str[i])) {
- break;
- }
- }
-
-done:
Py_XDECREF(source_line);
return err;
}