Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
97179b0f
Commit
97179b0f
authored
Sep 09, 2008
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #3634 invalid return value from _weakref.ref(Exception).__init__
Reviewers: Amaury, Antoine, Benjamin
parent
c0f10f34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
Lib/test/test_weakref.py
Lib/test/test_weakref.py
+8
-0
Misc/NEWS
Misc/NEWS
+3
-0
Objects/weakrefobject.c
Objects/weakrefobject.c
+1
-1
No files found.
Lib/test/test_weakref.py
View file @
97179b0f
...
...
@@ -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
):
...
...
Misc/NEWS
View file @
97179b0f
...
...
@@ -12,6 +12,9 @@ What's New in Python 2.6 release candidate 1?
Core and Builtins
-----------------
- Issue #3634: _weakref.ref(Exception).__init__() gave invalid return value on
error.
- Issue #3777: long() applied to a float object now always return a long
object; previously an int would be returned for small values. the __long__
method is allowed to return either an int or a long, but the behaviour of
...
...
Objects/weakrefobject.c
View file @
97179b0f
...
...
@@ -326,7 +326,7 @@ weakref___init__(PyObject *self, PyObject *args, PyObject *kwargs)
if
(
parse_weakref_init_args
(
"__init__"
,
args
,
kwargs
,
&
tmp
,
&
tmp
))
return
0
;
else
return
1
;
return
-
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment