File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ What's New in Python 3.7.0 alpha 1?
1010Core and Builtins
1111-----------------
1212
13+ - bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords.
14+ It should raise TypeError when kwargs is not a dict. But it might
15+ cause segv when args=NULL and kwargs is not a dict.
16+
1317- bpo-28598: Support __rmod__ for subclasses of str being called before
1418 str.__mod__. Patch by Martijn Pieters.
1519
Original file line number Diff line number Diff line change @@ -766,11 +766,7 @@ PyEval_CallObjectWithKeywords(PyObject *callable,
766766 assert (!PyErr_Occurred ());
767767#endif
768768
769- if (args == NULL ) {
770- return _PyObject_FastCallDict (callable , NULL , 0 , kwargs );
771- }
772-
773- if (!PyTuple_Check (args )) {
769+ if (args != NULL && !PyTuple_Check (args )) {
774770 PyErr_SetString (PyExc_TypeError ,
775771 "argument list must be a tuple" );
776772 return NULL ;
@@ -782,7 +778,12 @@ PyEval_CallObjectWithKeywords(PyObject *callable,
782778 return NULL ;
783779 }
784780
785- return PyObject_Call (callable , args , kwargs );
781+ if (args == NULL ) {
782+ return _PyObject_FastCallDict (callable , NULL , 0 , kwargs );
783+ }
784+ else {
785+ return PyObject_Call (callable , args , kwargs );
786+ }
786787}
787788
788789
You can’t perform that action at this time.
0 commit comments