mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix #3634 invalid return value from _weakref.ref(Exception).__init__
Reviewers: Amaury, Antoine, Benjamin
This commit is contained in:
parent
c0f10f34b1
commit
97179b0f58
3 changed files with 12 additions and 1 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue