summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEric V. Smith <eric@trueblade.com>2016-11-07 22:54:01 (GMT)
committerEric V. Smith <eric@trueblade.com>2016-11-07 22:54:01 (GMT)
commit9b88fdf4f09b77d866a3591c9e64b4e8a5b25920 (patch)
tree0dfd16d53f10e3c6768c95c0d28916e09ef6685a /Lib
parentf46b7823e6c64c1e0b6dd67643a45c71f5900b05 (diff)
downloadcpython-9b88fdf4f09b77d866a3591c9e64b4e8a5b25920.zip
cpython-9b88fdf4f09b77d866a3591c9e64b4e8a5b25920.tar.gz
cpython-9b88fdf4f09b77d866a3591c9e64b4e8a5b25920.tar.bz2
Fixed issue #28633: segfault when concatenating bytes literal and f-string.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_fstring.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py
index 086bf67..8205083 100644
--- a/Lib/test/test_fstring.py
+++ b/Lib/test/test_fstring.py
@@ -92,6 +92,13 @@ f'{a * x()}'"""
exec(c)
self.assertEqual(x[0], 'foo3')
+ def test_compile_time_concat_errors(self):
+ self.assertAllRaise(SyntaxError,
+ 'cannot mix bytes and nonbytes literals',
+ [r"""f'' b''""",
+ r"""b'' f''""",
+ ])
+
def test_literal(self):
self.assertEqual(f'', '')
self.assertEqual(f'a', 'a')