mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Closed issue #8931: Make alternate formatting for 'c' raise an exception. Patch by Torsten Landschoff.
This commit is contained in:
parent
9417764e01
commit
a0d107324d
3 changed files with 13 additions and 0 deletions
|
@ -343,6 +343,8 @@ class TypesTests(unittest.TestCase):
|
|||
self.assertRaises(ValueError, 3 .__format__, ",n")
|
||||
# can't have ',' with 'c'
|
||||
self.assertRaises(ValueError, 3 .__format__, ",c")
|
||||
# can't have '#' with 'c'
|
||||
self.assertRaises(ValueError, 3 .__format__, "#c")
|
||||
|
||||
# ensure that only int and float type specifiers work
|
||||
for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue