mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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.
This commit is contained in:
parent
f964154b8c
commit
2ccea17856
3 changed files with 9 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue