Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79035bd

Browse files
committed
Issue #15079: make a test applicable to both C and Python versions of the pickle module.
Patch by Stefan Mihaila.
1 parent b837192 commit 79035bd

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

Lib/test/pickletester.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,11 @@ def test_reduce(self):
707707
def test_getinitargs(self):
708708
pass
709709

710+
def test_pop_empty_stack(self):
711+
# Test issue7455
712+
s = b'0'
713+
self.assertRaises((pickle.UnpicklingError, IndexError), self.loads, s)
714+
710715
def test_metaclass(self):
711716
a = use_metaclass()
712717
for proto in protocols:
@@ -1383,9 +1388,6 @@ def test_bad_input(self):
13831388
# Test issue4298
13841389
s = bytes([0x58, 0, 0, 0, 0x54])
13851390
self.assertRaises(EOFError, pickle.loads, s)
1386-
# Test issue7455
1387-
s = b'0'
1388-
self.assertRaises(pickle.UnpicklingError, pickle.loads, s)
13891391

13901392

13911393
class AbstractPersistentPicklerTests(unittest.TestCase):

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ Mike Meyer
630630
Steven Miale
631631
Trent Mick
632632
Stan Mihai
633+
Stefan Mihaila
633634
Aristotelis Mikropoulos
634635
Damien Miller
635636
Chad Miller

0 commit comments

Comments
 (0)