summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-12-19 06:46:12 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-12-19 06:46:12 (GMT)
commitb46edf35f3dea8c828b45d6ae02d2c716dd1d0ea (patch)
tree0074b12ae7e8aada22b8753d69f66abde9128412 /Python
parent932ee73188c73bbe63834f69566a4f188fbf43a7 (diff)
parent619555d77bba05c71d9ef0a1c29ec53a17ebe2ca (diff)
downloadcpython-b46edf35f3dea8c828b45d6ae02d2c716dd1d0ea.zip
cpython-b46edf35f3dea8c828b45d6ae02d2c716dd1d0ea.tar.gz
cpython-b46edf35f3dea8c828b45d6ae02d2c716dd1d0ea.tar.bz2
Issue #25677: Merge SyntaxError caret positioning from 3.6
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 35c9e3a..3785e69 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -1138,11 +1138,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 b862e2b..5bddbad 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--;
}