Skip to content

Commit b6eebbb

Browse files
committed
(NFC) Remove unused truncated variable.
It is not used and hasn't been, so we can remove it. Remove i, len, and data too.
1 parent 09117bc commit b6eebbb

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

Python/_warnings.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -679,27 +679,7 @@ show_warning(PyThreadState *tstate, PyObject *filename, int lineno,
679679

680680
/* Print " source_line\n" */
681681
if (sourceline) {
682-
int kind;
683-
const void *data;
684-
Py_ssize_t i, len;
685-
Py_UCS4 ch;
686-
PyObject *truncated;
687-
688-
kind = PyUnicode_KIND(sourceline);
689-
data = PyUnicode_DATA(sourceline);
690-
len = PyUnicode_GET_LENGTH(sourceline);
691-
for (i=0; i<len; i++) {
692-
ch = PyUnicode_READ(kind, data, i);
693-
if (ch != ' ' && ch != '\t' && ch != '\014')
694-
break;
695-
}
696-
697-
truncated = PyUnicode_Substring(sourceline, i, len);
698-
if (truncated == NULL)
699-
goto error;
700-
701682
PyFile_WriteObject(sourceline, f_stderr, Py_PRINT_RAW);
702-
Py_DECREF(truncated);
703683
PyFile_WriteString("\n", f_stderr);
704684
}
705685
else {

0 commit comments

Comments
 (0)