diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-01-11 08:33:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-11 08:33:08 -0800 |
commit | 19a85501cee24a6e426a431243d0adcb5664c6fe (patch) | |
tree | 7fb844c0e7948a049d72a301251fb77fc1f59027 /Lib/test/test_exceptions.py | |
parent | 4cfb10979d74b8513ec751b81454709f38e3b51a (diff) | |
download | cpython-git-19a85501cee24a6e426a431243d0adcb5664c6fe.tar.gz |
bpo-46237: Fix the line number of tokenizer errors inside f-strings (GH-30463)
(cherry picked from commit 6fa8b2ceee38187b0ae96aee12fe4f0a5c8a2ce7)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r-- | Lib/test/test_exceptions.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index cc0640dda0..86b5dccaae 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -266,6 +266,18 @@ class ExceptionTests(unittest.TestCase): check("(1+)", 1, 4) check("[interesting\nfoo()\n", 1, 1) check(b"\xef\xbb\xbf#coding: utf8\nprint('\xe6\x88\x91')\n", 0, -1) + check("""f''' + { + (123_a) + }'''""", 3, 17) + check("""f''' + { + f\"\"\" + { + (123_a) + } + \"\"\" + }'''""", 5, 17) # Errors thrown by symtable.c check('x = [(yield i) for i in range(3)]', 1, 7) |