mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Closes #12579. Positional fields with str.format_map() now raise a ValueError instead of SystemError.
This commit is contained in:
parent
b899007268
commit
12ebefc9d3
4 changed files with 20 additions and 0 deletions
|
@ -736,6 +736,11 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
self.assertRaises(TypeError, '{a'.format_map)
|
||||
self.assertRaises(TypeError, '}a'.format_map)
|
||||
|
||||
# issue #12579: can't supply positional params to format_map
|
||||
self.assertRaises(ValueError, '{}'.format_map, {'a' : 2})
|
||||
self.assertRaises(ValueError, '{}'.format_map, 'a')
|
||||
self.assertRaises(ValueError, '{a} {}'.format_map, {"a" : 2, "b" : 1})
|
||||
|
||||
def test_format_auto_numbering(self):
|
||||
class C:
|
||||
def __init__(self, x=100):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue