From 94043dc6b155345f7e39a8658a17bed3b5d61d7d Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Sun, 11 Dec 2016 00:18:36 +0000 Subject: Issue #25677: Correct syntax error caret for indented blocks. Based on patch by Michael Layzell. --- Python/errors.c | 5 +---- Python/pythonrun.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'Python') diff --git a/Python/errors.c b/Python/errors.c index ebfb3fdf24..b820722dfa 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 72b6c9b060..90cb2de27c 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--; } -- cgit v1.2.1