summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEric V. Smith <eric@trueblade.com>2011-07-18 18:03:41 (GMT)
committerEric V. Smith <eric@trueblade.com>2011-07-18 18:03:41 (GMT)
commit12ebefc9d3b7268d17d4a042767f712c46d03dfe (patch)
treea9e5fce407f2f3c5006e2278d1c18868c9b80bcb /Lib
parentb899007268c53f2f169562bd0679fd5d688e185c (diff)
downloadcpython-12ebefc9d3b7268d17d4a042767f712c46d03dfe.zip
cpython-12ebefc9d3b7268d17d4a042767f712c46d03dfe.tar.gz
cpython-12ebefc9d3b7268d17d4a042767f712c46d03dfe.tar.bz2
Closes #12579. Positional fields with str.format_map() now raise a ValueError instead of SystemError.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_unicode.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 885e740..55aaba6 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -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):