Closed issue #8931: Make alternate formatting for 'c' raise an exception. Patch by Torsten Landschoff.

This commit is contained in:
Eric V. Smith 2014-04-15 03:05:02 -04:00
parent 9417764e01
commit a0d107324d
3 changed files with 13 additions and 0 deletions

View file

@ -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)] +