]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport my checkin of
authorMichael W. Hudson <mwh@python.net>
Tue, 5 Mar 2002 14:01:28 +0000 (14:01 +0000)
committerMichael W. Hudson <mwh@python.net>
Tue, 5 Mar 2002 14:01:28 +0000 (14:01 +0000)
    revision 1.13 of pickletester.py

A fix & test for

[ 496873 ] structseqs unpicklable

by adding a __reduce__ method to structseqs.

Will also commit this to the 2.2.1 branch momentarily.

Lib/test/pickletester.py

index 1b58edb9e461acb3dc10154dfe931f419291ae5c..e2d2580b8e5d0257fdd56b77629f503bab26b288 100644 (file)
@@ -248,6 +248,13 @@ class AbstractPickleTests(unittest.TestCase):
         b = self.loads(s)
         self.assertEqual(a.__class__, b.__class__)
 
+    def test_structseq(self):
+        import time
+        t = time.localtime()
+        s = self.dumps(t)
+        u = self.loads(s)
+        self.assertEqual(t, u)        
+
 class AbstractPickleModuleTests(unittest.TestCase):
 
     def test_dump_closed_file(self):