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
3824cd8f
Commit
3824cd8f
authored
Mar 01, 2017
by
INADA Naoki
Committed by
GitHub
Mar 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-29684: Fix regression of PyEval_CallObjectWithKeywords (GH-87)
It should raise TypeError when kwargs is not a dict.
parent
f5184745
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
Misc/NEWS
Misc/NEWS
+4
-0
Objects/call.c
Objects/call.c
+7
-6
No files found.
Misc/NEWS
View file @
3824cd8f
...
...
@@ -10,6 +10,10 @@ What's New in Python 3.7.0 alpha 1?
Core and Builtins
-----------------
- bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords.
It should raise TypeError when kwargs is not a dict. But it might
cause segv when args=NULL and kwargs is not a dict.
- bpo-28598: Support __rmod__ for subclasses of str being called before
str.__mod__. Patch by Martijn Pieters.
...
...
Objects/call.c
View file @
3824cd8f
...
...
@@ -766,11 +766,7 @@ PyEval_CallObjectWithKeywords(PyObject *callable,
assert
(
!
PyErr_Occurred
());
#endif
if
(
args
==
NULL
)
{
return
_PyObject_FastCallDict
(
callable
,
NULL
,
0
,
kwargs
);
}
if
(
!
PyTuple_Check
(
args
))
{
if
(
args
!=
NULL
&&
!
PyTuple_Check
(
args
))
{
PyErr_SetString
(
PyExc_TypeError
,
"argument list must be a tuple"
);
return
NULL
;
...
...
@@ -782,7 +778,12 @@ PyEval_CallObjectWithKeywords(PyObject *callable,
return
NULL
;
}
return
PyObject_Call
(
callable
,
args
,
kwargs
);
if
(
args
==
NULL
)
{
return
_PyObject_FastCallDict
(
callable
,
NULL
,
0
,
kwargs
);
}
else
{
return
PyObject_Call
(
callable
,
args
,
kwargs
);
}
}
...
...
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