summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-09-09 20:55:01 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-09-09 20:55:01 (GMT)
commit97179b0f58ebb13c6053096dc9fb7aff9f4abf33 (patch)
treea1c433d20d2640655da69e845afb19545d7aa727 /Lib
parentc0f10f34b13a8b70a776015c6be07b913209582f (diff)
downloadcpython-97179b0f58ebb13c6053096dc9fb7aff9f4abf33.zip
cpython-97179b0f58ebb13c6053096dc9fb7aff9f4abf33.tar.gz
cpython-97179b0f58ebb13c6053096dc9fb7aff9f4abf33.tar.bz2
Fix #3634 invalid return value from _weakref.ref(Exception).__init__
Reviewers: Amaury, Antoine, Benjamin
Diffstat (limited to 'Lib')
-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 c70804e..aeafdda 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):