Fix SF #749831, copy raises SystemError when getstate raises exception
diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py
index 0e39e83..c734a9a 100644
--- a/Lib/test/test_copy.py
+++ b/Lib/test/test_copy.py
@@ -515,6 +515,12 @@
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)