mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-30978: str.format_map() now passes key lookup exceptions through. (#2790)
Previously any exception was replaced with a KeyError exception.
This commit is contained in:
parent
25e4f779d7
commit
5075416b8f
4 changed files with 20 additions and 7 deletions
|
@ -468,7 +468,7 @@ class ReTests(unittest.TestCase):
|
|||
m[(0,)]
|
||||
with self.assertRaisesRegex(IndexError, 'no such group'):
|
||||
m[(0, 1)]
|
||||
with self.assertRaisesRegex(KeyError, 'a2'):
|
||||
with self.assertRaisesRegex(IndexError, 'no such group'):
|
||||
'a1={a2}'.format_map(m)
|
||||
|
||||
m = pat.match('ac')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue