diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-08-30 14:41:20 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-08-30 14:41:20 (GMT) |
commit | 33856de84d1115a18b699e0ca93c3b921bc6a1af (patch) | |
tree | d44532b9f9225284e4dc072f4a2ba657beefd54c /Lib/test/test_tokenize.py | |
parent | e01de8f2f3f8ec2ad58e1baddb7c2c657e331796 (diff) | |
download | cpython-33856de84d1115a18b699e0ca93c3b921bc6a1af.zip cpython-33856de84d1115a18b699e0ca93c3b921bc6a1af.tar.gz cpython-33856de84d1115a18b699e0ca93c3b921bc6a1af.tar.bz2 |
handle names starting with non-ascii characters correctly #9712
Diffstat (limited to 'Lib/test/test_tokenize.py')
-rw-r--r-- | Lib/test/test_tokenize.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index f72b2c6..4a82229 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -531,6 +531,7 @@ pass the '-ucompiler' option to process the full directory. True Evil tabs + >>> dump_tokens("def f():\\n\\tif x\\n \\tpass") ENCODING 'utf-8' (0, 0) (0, 0) NAME 'def' (1, 0) (1, 3) @@ -547,6 +548,18 @@ Evil tabs NAME 'pass' (3, 9) (3, 13) DEDENT '' (4, 0) (4, 0) DEDENT '' (4, 0) (4, 0) + +Non-ascii identifiers + + >>> dump_tokens("Örter = 'places'\\ngrün = 'green'") + ENCODING 'utf-8' (0, 0) (0, 0) + NAME 'Örter' (1, 0) (1, 5) + OP '=' (1, 6) (1, 7) + STRING "'places'" (1, 8) (1, 16) + NEWLINE '\\n' (1, 16) (1, 17) + NAME 'grün' (2, 0) (2, 4) + OP '=' (2, 5) (2, 6) + STRING "'green'" (2, 7) (2, 14) """ from test import support |