mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix SF #749831, copy raises SystemError when getstate raises exception
This commit is contained in:
parent
f0b1a1fca9
commit
e2fdc61004
2 changed files with 8 additions and 0 deletions
|
@ -515,6 +515,12 @@ class TestCopy(unittest.TestCase):
|
|||
self.assert_(x is not y)
|
||||
self.assert_(x[0] is not y[0])
|
||||
|
||||
def test_getstate_exc(self):
|
||||
class EvilState(object):
|
||||
def __getstate__(self):
|
||||
raise ValueError, "ain't got no stickin' state"
|
||||
self.assertRaises(ValueError, copy.copy, EvilState())
|
||||
|
||||
def test_main():
|
||||
test_support.run_unittest(TestCopy)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue