summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-12-11 00:18:36 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-12-11 00:18:36 (GMT)
commitca3263c50c3b3a3719d2ec3ee7b30b8c669dcb19 (patch)
treee18938b9e8d57f43e11c013c5d633fd64d9aca65 /Python
parentb94eef2ae3737b1f03452a30d5c96640c838dc46 (diff)
downloadcpython-ca3263c50c3b3a3719d2ec3ee7b30b8c669dcb19.zip
cpython-ca3263c50c3b3a3719d2ec3ee7b30b8c669dcb19.tar.gz
cpython-ca3263c50c3b3a3719d2ec3ee7b30b8c669dcb19.tar.bz2
Issue #25677: Correct syntax error caret for indented blocks.
Based on patch by Michael Layzell.
Diffstat (limited to 'Python')
-rw-r--r--Python/errors.c5
-rw-r--r--Python/pythonrun.c2
2 files changed, 2 insertions, 5 deletions
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 @@ err_programtext(FILE *fp, int lineno)
}
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 @@ print_error_text(PyObject *f, int offset, PyObject *text_obj)
offset -= (int)(nl+1-text);
text = nl+1;
}
- while (*text == ' ' || *text == '\t') {
+ while (*text == ' ' || *text == '\t' || *text == '\f') {
text++;
offset--;
}