summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-12-19 06:46:01 +0000
committerMartin Panter <vadmium+py@gmail.com>2016-12-19 06:46:01 +0000
commit42ba543f18789c526c888607b74fee4309ccfcc3 (patch)
treebddc6c6c19d95c8a6bc2dabc6dce873d70d10d70 /Python
parentd2131b6bd33e17101ba57b4ace0b2c6e3e104b3e (diff)
parent94043dc6b155345f7e39a8658a17bed3b5d61d7d (diff)
downloadcpython-42ba543f18789c526c888607b74fee4309ccfcc3.tar.gz
Issue #25677: Merge SyntaxError caret positioning from 3.5
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 fd6c42fd27..6095843815 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -1144,11 +1144,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 c881f901ab..8befa546a9 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--;
}