Skip to content
Prev Previous commit
Next Next commit
traceback.c: fix doc typo; simplify expression
  • Loading branch information
belm0 committed Jun 24, 2022
commit 6a8f56d92e4fdb432411ed747d08a32932f8e995
4 changes: 2 additions & 2 deletions Python/traceback.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ print_error_location_carets(PyObject *f, int offset, Py_ssize_t start_offset, Py
int special_chars = (left_end_offset != -1 || right_start_offset != -1);
const char *str;
while (++offset <= end_offset) {
if (offset <= start_offset || offset > end_offset) {
if (offset <= start_offset) {
str = " ";
} else if (special_chars && left_end_offset < offset && offset <= right_start_offset) {
str = secondary;
Expand Down Expand Up @@ -813,7 +813,7 @@ tb_displayline(PyTracebackObject* tb, PyObject *f, PyObject *filename, int linen
//
// ERROR LINE ERROR LINE ERROR LINE ERROR LINE ERROR LINE ERROR LINE ERROR LINE
// ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^~~~~~~~~~~~~~~~~~~~
// | |-> left_end_offset | |-> left_offset
// | |-> left_end_offset | |-> end_offset
Comment thread
belm0 marked this conversation as resolved.
// |-> start_offset |-> right_start_offset
//
// In general we will only have (start_offset, end_offset) but we can gather more information
Expand Down