summaryrefslogtreecommitdiff
path: root/Lib/test/test_weakref.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-09-09 20:55:01 +0000
committerBenjamin Peterson <benjamin@python.org>2008-09-09 20:55:01 +0000
commit0909f23faf4b1e842a3866875985020b6cf7e72d (patch)
tree52a5129da82bd4943664d32a4561e3d58ad02518 /Lib/test/test_weakref.py
parentd596024a62f42c5ccd9535e138a7f1bd81a39658 (diff)
downloadcpython-0909f23faf4b1e842a3866875985020b6cf7e72d.tar.gz
Fix #3634 invalid return value from _weakref.ref(Exception).__init__
Reviewers: Amaury, Antoine, Benjamin
Diffstat (limited to 'Lib/test/test_weakref.py')
-rw-r--r--Lib/test/test_weakref.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index c70804e829..aeafddab72 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -665,6 +665,14 @@ class ReferencesTestCase(TestBase):
w = Target()
+ def test_init(self):
+ # Issue 3634
+ # <weakref to class>.__init__() doesn't check errors correctly
+ r = weakref.ref(Exception)
+ self.assertRaises(TypeError, r.__init__, 0, 0, 0, 0, 0)
+ # No exception should be raised here
+ gc.collect()
+
class SubclassableWeakrefTestCase(TestBase):