mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
gh-104825: Remove implicit newline in the line attribute in tokens emitted in the tokenize module (#104846)
This commit is contained in:
parent
c45701e9ef
commit
c8cf9b42eb
5 changed files with 14 additions and 8 deletions
|
@ -103,7 +103,7 @@ def k(x):
|
|||
e.exception.msg,
|
||||
'unindent does not match any outer indentation level')
|
||||
self.assertEqual(e.exception.offset, 9)
|
||||
self.assertEqual(e.exception.text, ' x += 5\n')
|
||||
self.assertEqual(e.exception.text, ' x += 5')
|
||||
|
||||
def test_int(self):
|
||||
# Ordinary integers and binary operators
|
||||
|
@ -1157,7 +1157,7 @@ class Test_Tokenize(TestCase):
|
|||
|
||||
# skip the initial encoding token and the end tokens
|
||||
tokens = list(_tokenize(readline(), encoding='utf-8'))[:-2]
|
||||
expected_tokens = [TokenInfo(3, '"ЉЊЈЁЂ"', (1, 0), (1, 7), '"ЉЊЈЁЂ"\n')]
|
||||
expected_tokens = [TokenInfo(3, '"ЉЊЈЁЂ"', (1, 0), (1, 7), '"ЉЊЈЁЂ"')]
|
||||
self.assertEqual(tokens, expected_tokens,
|
||||
"bytes not decoded with encoding")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue