Fixes #13842: cannot pickle Ellipsis or NotImplemented.

Thanks for James Sanders for the bug report and the patch.
This commit is contained in:
Łukasz Langa 2012-03-12 19:46:12 +01:00
parent e976fc7464
commit f3078fbee2
4 changed files with 42 additions and 0 deletions

View file

@ -743,6 +743,18 @@ class AbstractPickleTests(unittest.TestCase):
u = self.loads(s)
self.assertEqual(t, u)
def test_ellipsis(self):
for proto in protocols:
s = self.dumps(..., proto)
u = self.loads(s)
self.assertEqual(..., u)
def test_notimplemented(self):
for proto in protocols:
s = self.dumps(NotImplemented, proto)
u = self.loads(s)
self.assertEqual(NotImplemented, u)
# Tests for protocol 2
def test_proto(self):