def test_bad_input(self):
# Test issue4298
s = bytes([0x58, 0, 0, 0, 0x54])
self.assertRaises(EOFError, pickle.loads, s)
# Test issue7455
s = b'0'
self.assertRaises((pickle.UnpicklingError, IndexError),
pickle.loads, s)
评论列表
文章目录