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
17e22959
Commit
17e22959
authored
May 07, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #17765: weakref.ref() no longer silently ignores keyword arguments.
Patch by Georg Brandl.
parents
1acbf853
21eb4876
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
Lib/test/test_weakref.py
Lib/test/test_weakref.py
+4
-0
Misc/NEWS
Misc/NEWS
+3
-0
Objects/weakrefobject.c
Objects/weakrefobject.c
+3
-1
No files found.
Lib/test/test_weakref.py
View file @
17e22959
...
...
@@ -133,6 +133,10 @@ class ReferencesTestCase(TestBase):
ref1
=
weakref
.
ref
(
c
,
callback
)
del
c
def
test_constructor_kwargs
(
self
):
c
=
C
()
self
.
assertRaises
(
TypeError
,
weakref
.
ref
,
c
,
callback
=
None
)
def
test_proxy_ref
(
self
):
o
=
C
()
o
.
bar
=
1
...
...
Misc/NEWS
View file @
17e22959
...
...
@@ -265,6 +265,9 @@ Core and Builtins
Library
-------
-
Issue
#
17765
:
weakref
.
ref
()
no
longer
silently
ignores
keyword
arguments
.
Patch
by
Georg
Brandl
.
-
Issue
#
26873
:
xmlrpc
now
raises
ResponseError
on
unsupported
type
tags
instead
of
silently
return
incorrect
result
.
...
...
Objects/weakrefobject.c
View file @
17e22959
...
...
@@ -268,7 +268,6 @@ static int
parse_weakref_init_args
(
const
char
*
funcname
,
PyObject
*
args
,
PyObject
*
kwargs
,
PyObject
**
obp
,
PyObject
**
callbackp
)
{
/* XXX Should check that kwargs == NULL or is empty. */
return
PyArg_UnpackTuple
(
args
,
funcname
,
1
,
2
,
obp
,
callbackp
);
}
...
...
@@ -331,6 +330,9 @@ weakref___init__(PyObject *self, PyObject *args, PyObject *kwargs)
{
PyObject
*
tmp
;
if
(
!
_PyArg_NoKeywords
(
"ref()"
,
kwargs
))
return
-
1
;
if
(
parse_weakref_init_args
(
"__init__"
,
args
,
kwargs
,
&
tmp
,
&
tmp
))
return
0
;
else
...
...
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