mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #25677: Merge SyntaxError caret positioning from 3.6
This commit is contained in:
commit
b46edf35f3
5 changed files with 39 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue