diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/Python-tokenize.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/Python-tokenize.c b/Python/Python-tokenize.c index 2cf052a..1938562 100644 --- a/Python/Python-tokenize.c +++ b/Python/Python-tokenize.c @@ -206,6 +206,9 @@ tokenizeriter_next(tokenizeriterobject *it) line = PyUnicode_FromString(""); } else { Py_ssize_t size = it->tok->inp - line_start; + if (size >= 1 && it->tok->implicit_newline) { + size -= 1; + } line = PyUnicode_DecodeUTF8(line_start, size, "replace"); } if (line == NULL) { |