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?
10
10
Core and Builtins
11
11
-----------------
12
12
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
+
13
17
- bpo-28598: Support __rmod__ for subclasses of str being called before
14
18
str.__mod__. Patch by Martijn Pieters.
15
19
Original file line number Diff line number Diff line change @@ -766,11 +766,7 @@ PyEval_CallObjectWithKeywords(PyObject *callable,
766
766
assert (!PyErr_Occurred ());
767
767
#endif
768
768
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 )) {
774
770
PyErr_SetString (PyExc_TypeError ,
775
771
"argument list must be a tuple" );
776
772
return NULL ;
@@ -782,7 +778,12 @@ PyEval_CallObjectWithKeywords(PyObject *callable,
782
778
return NULL ;
783
779
}
784
780
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
+ }
786
787
}
787
788
788
789
You can’t perform that action at this time.
0 commit comments