py/objstr: Fix error type for badly formatted format specifier.

Was KeyError, should be ValueError.
This commit is contained in:
Damien George
2015-08-26 15:42:25 +01:00
parent 51b9a0d0c4
commit 7ef75f9f75
2 changed files with 11 additions and 1 deletions

View File

@@ -194,3 +194,8 @@ try:
'{0:s}'.format(1)
except ValueError:
print('ValueError')
try:
'{:*"1"}'.format('zz')
except ValueError:
print('ValueError')