@@ -1229,7 +1229,7 @@ def readline():
1229
1229
# skip the initial encoding token and the end tokens
1230
1230
tokens = list (_generate_tokens_from_c_tokenizer (readline ().__next__ , encoding = 'utf-8' ,
1231
1231
extra_tokens = True ))[:- 2 ]
1232
- expected_tokens = [TokenInfo (3 , '"ЉЊЈЁЂ"' , (1 , 0 ), (1 , 7 ), '"ЉЊЈЁЂ"\n ' )]
1232
+ expected_tokens = [TokenInfo (3 , '"ЉЊЈЁЂ"' , (1 , 0 ), (1 , 7 ), '"ЉЊЈЁЂ"' )]
1233
1233
self .assertEqual (tokens , expected_tokens ,
1234
1234
"bytes not decoded with encoding" )
1235
1235
@@ -1638,8 +1638,8 @@ def test_comment_at_the_end_of_the_source_without_newline(self):
1638
1638
TokenInfo (type = token .NUMBER , string = '1' , start = (1 , 4 ), end = (1 , 5 ), line = 'b = 1\n ' ),
1639
1639
TokenInfo (type = token .NEWLINE , string = '\n ' , start = (1 , 5 ), end = (1 , 6 ), line = 'b = 1\n ' ),
1640
1640
TokenInfo (type = token .NL , string = '\n ' , start = (2 , 0 ), end = (2 , 1 ), line = '\n ' ),
1641
- TokenInfo (type = token .COMMENT , string = '#test' , start = (3 , 0 ), end = (3 , 5 ), line = '#test\n ' ),
1642
- TokenInfo (type = token .NL , string = '' , start = (3 , 5 ), end = (3 , 6 ), line = '#test\n ' ),
1641
+ TokenInfo (type = token .COMMENT , string = '#test' , start = (3 , 0 ), end = (3 , 5 ), line = '#test' ),
1642
+ TokenInfo (type = token .NL , string = '' , start = (3 , 5 ), end = (3 , 6 ), line = '#test' ),
1643
1643
TokenInfo (type = token .ENDMARKER , string = '' , start = (4 , 0 ), end = (4 , 0 ), line = '' )
1644
1644
]
1645
1645
@@ -1653,7 +1653,7 @@ def test_newline_and_space_at_the_end_of_the_source_without_newline(self):
1653
1653
TokenInfo (token .ENCODING , string = 'utf-8' , start = (0 , 0 ), end = (0 , 0 ), line = '' ),
1654
1654
TokenInfo (token .NAME , string = 'a' , start = (1 , 0 ), end = (1 , 1 ), line = 'a\n ' ),
1655
1655
TokenInfo (token .NEWLINE , string = '\n ' , start = (1 , 1 ), end = (1 , 2 ), line = 'a\n ' ),
1656
- TokenInfo (token .NL , string = '' , start = (2 , 1 ), end = (2 , 2 ), line = ' \n ' ),
1656
+ TokenInfo (token .NL , string = '' , start = (2 , 1 ), end = (2 , 2 ), line = ' ' ),
1657
1657
TokenInfo (token .ENDMARKER , string = '' , start = (3 , 0 ), end = (3 , 0 ), line = '' )
1658
1658
]
1659
1659
@@ -1889,10 +1889,10 @@ def readline(encoding):
1889
1889
yield "1+1" .encode (encoding )
1890
1890
1891
1891
expected = [
1892
- TokenInfo (type = NUMBER , string = '1' , start = (1 , 0 ), end = (1 , 1 ), line = '1+1\n ' ),
1893
- TokenInfo (type = OP , string = '+' , start = (1 , 1 ), end = (1 , 2 ), line = '1+1\n ' ),
1894
- TokenInfo (type = NUMBER , string = '1' , start = (1 , 2 ), end = (1 , 3 ), line = '1+1\n ' ),
1895
- TokenInfo (type = NEWLINE , string = '' , start = (1 , 3 ), end = (1 , 4 ), line = '1+1\n ' ),
1892
+ TokenInfo (type = NUMBER , string = '1' , start = (1 , 0 ), end = (1 , 1 ), line = '1+1' ),
1893
+ TokenInfo (type = OP , string = '+' , start = (1 , 1 ), end = (1 , 2 ), line = '1+1' ),
1894
+ TokenInfo (type = NUMBER , string = '1' , start = (1 , 2 ), end = (1 , 3 ), line = '1+1' ),
1895
+ TokenInfo (type = NEWLINE , string = '' , start = (1 , 3 ), end = (1 , 4 ), line = '1+1' ),
1896
1896
TokenInfo (type = ENDMARKER , string = '' , start = (2 , 0 ), end = (2 , 0 ), line = '' )
1897
1897
]
1898
1898
for encoding in ["utf-8" , "latin-1" , "utf-16" ]:
0 commit comments