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.
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;
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);
+ }
}