mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #9696: Fix exception incorrectly raised by xdrlib.Packer.pack_int when trying to pack a negative (in-range) integer.
This commit is contained in:
parent
ccd2283c6f
commit
92b60d55d9
4 changed files with 9 additions and 1 deletions
|
@ -12,6 +12,7 @@ class XDRTest(unittest.TestCase):
|
|||
a = [b'what', b'is', b'hapnin', b'doctor']
|
||||
|
||||
p.pack_int(42)
|
||||
p.pack_int(-17)
|
||||
p.pack_uint(9)
|
||||
p.pack_bool(True)
|
||||
p.pack_bool(False)
|
||||
|
@ -29,6 +30,7 @@ class XDRTest(unittest.TestCase):
|
|||
self.assertEqual(up.get_position(), 0)
|
||||
|
||||
self.assertEqual(up.unpack_int(), 42)
|
||||
self.assertEqual(up.unpack_int(), -17)
|
||||
self.assertEqual(up.unpack_uint(), 9)
|
||||
self.assertTrue(up.unpack_bool() is True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue