mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
closes bpo-34868: Improve error message with '_' is combined with an invalid type specifier. (GH-9666)
This commit is contained in:
parent
30534cc717
commit
cbda8fc5d7
2 changed files with 12 additions and 8 deletions
|
@ -700,6 +700,9 @@ class LongTest(unittest.TestCase):
|
|||
self.assertRaisesRegex(ValueError, 'Cannot specify both', format, 3, '_,d')
|
||||
self.assertRaisesRegex(ValueError, 'Cannot specify both', format, 3, ',_d')
|
||||
|
||||
self.assertRaisesRegex(ValueError, "Cannot specify ',' with 's'", format, 3, ',s')
|
||||
self.assertRaisesRegex(ValueError, "Cannot specify '_' with 's'", format, 3, '_s')
|
||||
|
||||
# ensure that only int and float type specifiers work
|
||||
for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] +
|
||||
[chr(x) for x in range(ord('A'), ord('Z')+1)]):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue