mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
[3.10] bpo-46091: Correctly calculate indentation levels for whitespace lines with continuation characters (GH-30130). (GH-30898)
(cherry picked from commit a0efc0c196
)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
parent
4a57fa296b
commit
3fc8b74ace
5 changed files with 67 additions and 16 deletions
|
@ -6,6 +6,7 @@ from tokenize import (tokenize, _tokenize, untokenize, NUMBER, NAME, OP,
|
|||
NEWLINE)
|
||||
from io import BytesIO, StringIO
|
||||
import unittest
|
||||
from textwrap import dedent
|
||||
from unittest import TestCase, mock
|
||||
from test.test_grammar import (VALID_UNDERSCORE_LITERALS,
|
||||
INVALID_UNDERSCORE_LITERALS)
|
||||
|
@ -45,7 +46,6 @@ class TokenizeTest(TestCase):
|
|||
# The ENDMARKER and final NEWLINE are omitted.
|
||||
f = BytesIO(s.encode('utf-8'))
|
||||
result = stringify_tokens_from_source(tokenize(f.readline), s)
|
||||
|
||||
self.assertEqual(result,
|
||||
[" ENCODING 'utf-8' (0, 0) (0, 0)"] +
|
||||
expected.rstrip().splitlines())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue