mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
bpo-32037: Use the INT opcode for 32-bit integers in protocol 0 pickles. (#4407)
This commit is contained in:
parent
0a2abdfca2
commit
3daaafb700
5 changed files with 69 additions and 62 deletions
|
@ -1821,7 +1821,7 @@ class AbstractPickleTests(unittest.TestCase):
|
|||
with self.subTest(proto=proto):
|
||||
s = self.dumps(x, proto)
|
||||
if proto < 1:
|
||||
self.assertIn(b'\nL64206', s) # LONG
|
||||
self.assertIn(b'\nI64206', s) # INT
|
||||
else:
|
||||
self.assertIn(b'M\xce\xfa', s) # BININT2
|
||||
self.assertEqual(opcode_in_pickle(pickle.NEWOBJ, s),
|
||||
|
@ -1837,7 +1837,7 @@ class AbstractPickleTests(unittest.TestCase):
|
|||
with self.subTest(proto=proto):
|
||||
s = self.dumps(x, proto)
|
||||
if proto < 1:
|
||||
self.assertIn(b'\nL64206', s) # LONG
|
||||
self.assertIn(b'\nI64206', s) # INT
|
||||
elif proto < 2:
|
||||
self.assertIn(b'M\xce\xfa', s) # BININT2
|
||||
elif proto < 4:
|
||||
|
@ -1857,7 +1857,7 @@ class AbstractPickleTests(unittest.TestCase):
|
|||
with self.subTest(proto=proto):
|
||||
s = self.dumps(x, proto)
|
||||
if proto < 1:
|
||||
self.assertIn(b'\nL64206', s) # LONG
|
||||
self.assertIn(b'\nI64206', s) # INT
|
||||
elif proto < 2:
|
||||
self.assertIn(b'M\xce\xfa', s) # BININT2
|
||||
elif proto < 4:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue