Issue #25677: Correct syntax error caret for indented blocks.
Based on patch by Michael Layzell.
diff --git a/Python/errors.c b/Python/errors.c
index ebfb3fd..b820722 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -1094,11 +1094,8 @@
}
fclose(fp);
if (i == lineno) {
- char *p = linebuf;
PyObject *res;
- while (*p == ' ' || *p == '\t' || *p == '\014')
- p++;
- res = PyUnicode_FromString(p);
+ res = PyUnicode_FromString(linebuf);
if (res == NULL)
PyErr_Clear();
return res;
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 72b6c9b..90cb2de 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -528,7 +528,7 @@
offset -= (int)(nl+1-text);
text = nl+1;
}
- while (*text == ' ' || *text == '\t') {
+ while (*text == ' ' || *text == '\t' || *text == '\f') {
text++;
offset--;
}