mirror of
https://github.com/python/cpython.git
synced 2025-09-23 17:03:23 +00:00
Fix SyntaxError
indicator printing too many spaces for multi-line strings (GH-14433)
(cherry picked from commit 5b94f3578c
)
Co-authored-by: Anthony Sottile <asottile@umich.edu>
This commit is contained in:
parent
36fd7b6f01
commit
cf52bd0b9b
3 changed files with 17 additions and 0 deletions
|
@ -956,6 +956,7 @@ tok_nextc(struct tok_state *tok)
|
|||
while (!done) {
|
||||
Py_ssize_t curstart = tok->start == NULL ? -1 :
|
||||
tok->start - tok->buf;
|
||||
Py_ssize_t cur_multi_line_start = tok->multi_line_start - tok->buf;
|
||||
Py_ssize_t curvalid = tok->inp - tok->buf;
|
||||
Py_ssize_t newsize = curvalid + BUFSIZ;
|
||||
char *newbuf = tok->buf;
|
||||
|
@ -968,6 +969,7 @@ tok_nextc(struct tok_state *tok)
|
|||
}
|
||||
tok->buf = newbuf;
|
||||
tok->cur = tok->buf + cur;
|
||||
tok->multi_line_start = tok->buf + cur_multi_line_start;
|
||||
tok->line_start = tok->cur;
|
||||
tok->inp = tok->buf + curvalid;
|
||||
tok->end = tok->buf + newsize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue