Skip to content

Commit ef2ab1a

Browse files
committed
Revert "pythongh-119780: Adjust exception messages in Lib/test/test_format.py"
This reverts commit 7849c66.
1 parent 7f9b4d0 commit ef2ab1a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Lib/test/test_format.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ def test_str_format(self):
305305
test_exc('%c', sys.maxunicode+1, OverflowError,
306306
"%c arg not in range(0x110000)")
307307
#test_exc('%c', 2**128, OverflowError, "%c arg not in range(0x110000)")
308-
test_exc('%c', 3.14, TypeError, "%c requires an int or a unicode character, not float")
309-
test_exc('%c', 'ab', TypeError, "%c requires an int or a unicode character, not a string of length 2")
310-
test_exc('%c', b'x', TypeError, "%c requires an int or a unicode character, not bytes")
308+
test_exc('%c', 3.14, TypeError, "%c requires int or char")
309+
test_exc('%c', 'ab', TypeError, "%c requires int or char")
310+
test_exc('%c', b'x', TypeError, "%c requires int or char")
311311

312312
if maxsize == 2**31-1:
313313
# crashes 2.2.1 and earlier:
@@ -371,11 +371,11 @@ def __bytes__(self):
371371
test_exc(b"%c", 2**128, OverflowError,
372372
"%c arg not in range(256)")
373373
test_exc(b"%c", b"Za", TypeError,
374-
"%c requires an integer in range(256) or a single byte, not a bytes object of length 2")
374+
"%c requires an integer in range(256) or a single byte")
375375
test_exc(b"%c", "Y", TypeError,
376-
"%c requires an integer in range(256) or a single byte, not str")
376+
"%c requires an integer in range(256) or a single byte")
377377
test_exc(b"%c", 3.14, TypeError,
378-
"%c requires an integer in range(256) or a single byte, not float")
378+
"%c requires an integer in range(256) or a single byte")
379379
test_exc(b"%b", "Xc", TypeError,
380380
"%b requires a bytes-like object, "
381381
"or an object that implements __bytes__, not 'str'")

0 commit comments

Comments
 (0)