mirror of
https://github.com/python/cpython.git
synced 2025-09-30 20:31:52 +00:00
bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. (GH-378)
This commit is contained in:
parent
1b93ed4f3e
commit
023532e558
2 changed files with 11 additions and 6 deletions
|
@ -10,6 +10,10 @@ What's New in Python 3.6.1 release candidate 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.
|
||||
|
||||
- Issue #28598: Support __rmod__ for subclasses of str being called before
|
||||
str.__mod__. Patch by Martijn Pieters.
|
||||
|
||||
|
|
|
@ -4699,11 +4699,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs)
|
|||
assert(!PyErr_Occurred());
|
||||
#endif
|
||||
|
||||
if (args == NULL) {
|
||||
return _PyObject_FastCallDict(func, 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;
|
||||
|
@ -4715,7 +4711,12 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (args == NULL) {
|
||||
return _PyObject_FastCallDict(func, NULL, 0, kwargs);
|
||||
}
|
||||
else {
|
||||
return PyObject_Call(func, args, kwargs);
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue