summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-05-27 17:24:30 (GMT)
committerGitHub <noreply@github.com>2023-05-27 17:24:30 (GMT)
commit2b176bc90269b400226d0219a05e9b4c49604c51 (patch)
tree7912e26d5c834b7cb217ae2c16c952b83f92dce5 /Lib
parentedd0cb8e77d7b65f5a9c2c69dc81f9c4514878d5 (diff)
downloadcpython-2b176bc90269b400226d0219a05e9b4c49604c51.zip
cpython-2b176bc90269b400226d0219a05e9b4c49604c51.tar.gz
cpython-2b176bc90269b400226d0219a05e9b4c49604c51.tar.bz2
[3.12] gh-105017: Fix including additional NL token when using CRLF (GH-105022) (#105023)
Co-authored-by: Marta Gómez Macías <mgmacias@google.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_tokenize.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py
index abb6885..293592b 100644
--- a/Lib/test/test_tokenize.py
+++ b/Lib/test/test_tokenize.py
@@ -84,6 +84,14 @@ class TokenizeTest(TestCase):
NEWLINE '\\n' (4, 26) (4, 27)
DEDENT '' (5, 0) (5, 0)
""")
+
+ self.check_tokenize("foo='bar'\r\n", """\
+ NAME 'foo' (1, 0) (1, 3)
+ OP '=' (1, 3) (1, 4)
+ STRING "'bar'" (1, 4) (1, 9)
+ NEWLINE '\\n' (1, 9) (1, 10)
+ """)
+
indent_error_file = b"""\
def k(x):
x += 2