Implemented proto 2 NEWTRUE and NEWFALSE in cPickle.
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 7214298..f1a1384 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -502,6 +502,12 @@
y = self.loads(s)
self.assert_(x is y, (proto, x, s, y))
+ # Test that proto >= 2 really uses the bool opcodes.
+ if proto >= 2 and x in (False, True):
+ expected = x and pickle.NEWTRUE or pickle.NEWFALSE
+ # Skip the PROTO opcode at the start.
+ self.assertEqual(s[2], expected)
+
def test_newobj_tuple(self):
x = MyTuple([1, 2, 3])
x.foo = 42