@@ -278,8 +278,6 @@ def test_common_format(self):
278278 "unsupported format %z at position 4" )
279279 test_exc_common ("abc %Id" , 1 , ValueError ,
280280 "unsupported format %I at position 4" )
281- test_exc_common ("abc %'d" , 1 , ValueError ,
282- "stray % at position 4 or unexpected format character ''' at position 5" )
283281 test_exc_common ("abc %1 d" , 1 , ValueError ,
284282 "stray % at position 4 or unexpected format character ' ' at position 6" )
285283 test_exc_common ('abc % (x)r' , {}, ValueError ,
@@ -363,6 +361,8 @@ def test_str_format(self):
363361 print ('Testing exceptions' )
364362 test_exc ('abc %b' , 1 , ValueError ,
365363 "unsupported format %b at position 4" )
364+ test_exc ("abc %'d" , 1 , ValueError ,
365+ "stray % at position 4 or unexpected format character ''' (U+0027) at position 5" )
366366 test_exc ("abc %\n d" , 1 , ValueError ,
367367 "stray % at position 4 or unexpected format character U+000A at position 5" )
368368 test_exc ("abc %\x1f d" , 1 , ValueError ,
@@ -465,6 +465,8 @@ def __bytes__(self):
465465 print ('Testing exceptions' )
466466 test_exc (b"abc %\n d" , 1 , ValueError ,
467467 "stray % at position 4 or unexpected format character with code 0x0a at position 5" )
468+ test_exc (b"abc %'d" , 1 , ValueError ,
469+ "stray % at position 4 or unexpected format character with code 0x27 at position 5" )
468470 test_exc (b"abc %\x1f d" , 1 , ValueError ,
469471 "stray % at position 4 or unexpected format character with code 0x1f at position 5" )
470472 test_exc (b"abc %\x7f d" , 1 , ValueError ,
0 commit comments