summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-12-11 00:18:36 +0000
committerMartin Panter <vadmium+py@gmail.com>2016-12-11 00:18:36 +0000
commit94043dc6b155345f7e39a8658a17bed3b5d61d7d (patch)
treec7d70ab684baafb9a5f129a89105856e5f4feef5 /Python/errors.c
parentc3ec82eb622bc9be403a6f7f5ce7674ddd66f40c (diff)
downloadcpython-94043dc6b155345f7e39a8658a17bed3b5d61d7d.tar.gz
Issue #25677: Correct syntax error caret for indented blocks.
Based on patch by Michael Layzell.
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c5
1 files changed, 1 insertions, 4 deletions
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;