mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Make test_base64 pass.
Change binascii.Error to derive from ValueError and raise binascii.Error everywhere where values are bad (why on earth did the old code use TypeError?!?).
This commit is contained in:
parent
0e225aa09b
commit
4581ae5fa2
5 changed files with 268 additions and 232 deletions
|
|
@ -118,8 +118,8 @@ class BinASCIITest(unittest.TestCase):
|
|||
t = binascii.b2a_hex(s)
|
||||
u = binascii.a2b_hex(t)
|
||||
self.assertEqual(s, u)
|
||||
self.assertRaises(TypeError, binascii.a2b_hex, t[:-1])
|
||||
self.assertRaises(TypeError, binascii.a2b_hex, t[:-1] + b'q')
|
||||
self.assertRaises(binascii.Error, binascii.a2b_hex, t[:-1])
|
||||
self.assertRaises(binascii.Error, binascii.a2b_hex, t[:-1] + b'q')
|
||||
|
||||
# Verify the treatment of Unicode strings
|
||||
if test_support.have_unicode:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue