@@ -304,9 +304,9 @@ def test_str_format(self):
304
304
test_exc ('%c' , sys .maxunicode + 1 , OverflowError ,
305
305
"%c arg not in range(0x110000)" )
306
306
#test_exc('%c', 2**128, OverflowError, "%c arg not in range(0x110000)")
307
- test_exc ('%c' , 3.14 , TypeError , "%c requires int or char " )
308
- test_exc ('%c' , 'ab' , TypeError , "%c requires int or char " )
309
- test_exc ('%c' , b'x' , TypeError , "%c requires int or char " )
307
+ test_exc ('%c' , 3.14 , TypeError , "%c requires an int or a unicode character, not float " )
308
+ test_exc ('%c' , 'ab' , TypeError , "%c requires an int or a unicode character, not a string of length 2 " )
309
+ test_exc ('%c' , b'x' , TypeError , "%c requires an int or a unicode character, not bytes " )
310
310
311
311
if maxsize == 2 ** 31 - 1 :
312
312
# crashes 2.2.1 and earlier:
@@ -370,11 +370,11 @@ def __bytes__(self):
370
370
test_exc (b"%c" , 2 ** 128 , OverflowError ,
371
371
"%c arg not in range(256)" )
372
372
test_exc (b"%c" , b"Za" , TypeError ,
373
- "%c requires an integer in range(256) or a single byte" )
373
+ "%c requires an integer in range(256) or a single byte, not a bytes object of length 2 " )
374
374
test_exc (b"%c" , "Y" , TypeError ,
375
- "%c requires an integer in range(256) or a single byte" )
375
+ "%c requires an integer in range(256) or a single byte, not str " )
376
376
test_exc (b"%c" , 3.14 , TypeError ,
377
- "%c requires an integer in range(256) or a single byte" )
377
+ "%c requires an integer in range(256) or a single byte, not float " )
378
378
test_exc (b"%b" , "Xc" , TypeError ,
379
379
"%b requires a bytes-like object, "
380
380
"or an object that implements __bytes__, not 'str'" )
0 commit comments