@@ -304,9 +304,9 @@ def test_str_format(self):
304304 test_exc ('%c' , sys .maxunicode + 1 , OverflowError ,
305305 "%c arg not in range(0x110000)" )
306306 #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 " )
310310
311311 if maxsize == 2 ** 31 - 1 :
312312 # crashes 2.2.1 and earlier:
@@ -370,11 +370,11 @@ def __bytes__(self):
370370 test_exc (b"%c" , 2 ** 128 , OverflowError ,
371371 "%c arg not in range(256)" )
372372 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 " )
374374 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 " )
376376 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 " )
378378 test_exc (b"%b" , "Xc" , TypeError ,
379379 "%b requires a bytes-like object, "
380380 "or an object that implements __bytes__, not 'str'" )
0 commit comments