summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_marshal.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2004-12-20 12:25:57 (GMT)
committerArmin Rigo <arigo@tunes.org>2004-12-20 12:25:57 (GMT)
commit2ccea1785603ad35a05f75f40e9dc7fc82caa346 (patch)
treed20a28547d53beb536dd97b5a11d238945d42c18 /Lib/test/test_marshal.py
parentf964154b8cb74a05a3664cd34e938c0298f97680 (diff)
downloadcpython-2ccea1785603ad35a05f75f40e9dc7fc82caa346.zip
cpython-2ccea1785603ad35a05f75f40e9dc7fc82caa346.tar.gz
cpython-2ccea1785603ad35a05f75f40e9dc7fc82caa346.tar.bz2
Any call to marshal.dumps() with the new optional argument 'version' just
immediately segfaults, due to a typo! This was obviously never tested... Added a test for it, and also fixed the documentation.
Diffstat (limited to 'Lib/test/test_marshal.py')
-rw-r--r--Lib/test/test_marshal.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index eb07521..5c1a3f3 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -180,6 +180,11 @@ class BugsTestCase(unittest.TestCase):
self.assertRaises(Exception, marshal.loads, 'f')
self.assertRaises(Exception, marshal.loads, marshal.dumps(5L)[:-1])
+ def test_version_argument(self):
+ # Python 2.4.0 crashes for any call to marshal.dumps(x, y)
+ self.assertEquals(marshal.loads(marshal.dumps(5, 0)), 5)
+ self.assertEquals(marshal.loads(marshal.dumps(5, 1)), 5)
+
def test_main():
test_support.run_unittest(IntTestCase,
FloatTestCase,