Skip to content

Commit a6ca997

Browse files
committed
(NFC) Remove unused truncated variable.
It is not used and hasn't been, so we can remove it.
1 parent 878b5e2 commit a6ca997

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

Python/_warnings.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,6 @@ show_warning(PyThreadState *tstate, PyObject *filename, int lineno,
683683
const void *data;
684684
Py_ssize_t i, len;
685685
Py_UCS4 ch;
686-
PyObject *truncated;
687686

688687
kind = PyUnicode_KIND(sourceline);
689688
data = PyUnicode_DATA(sourceline);
@@ -694,12 +693,7 @@ show_warning(PyThreadState *tstate, PyObject *filename, int lineno,
694693
break;
695694
}
696695

697-
truncated = PyUnicode_Substring(sourceline, i, len);
698-
if (truncated == NULL)
699-
goto error;
700-
701696
PyFile_WriteObject(sourceline, f_stderr, Py_PRINT_RAW);
702-
Py_DECREF(truncated);
703697
PyFile_WriteString("\n", f_stderr);
704698
}
705699
else {

0 commit comments

Comments
 (0)