summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index e407de4..902d529 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1970,18 +1970,17 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
*/
if (PyCFunction_Check(func)) {
int flags = PyCFunction_GET_FLAGS(func);
- if (flags == METH_VARARGS) {
+ if (flags > 1 || nk != 0)
+ x = do_call(func, &stack_pointer,
+ na, nk);
+ else if (flags == METH_VARARGS) {
PyObject *callargs;
callargs = load_args(&stack_pointer, na);
x = call_cfunction(func, callargs, NULL);
Py_XDECREF(callargs);
- } else if (flags == 0) {
+ } else if (flags == 0)
x = fast_cfunction(func,
&stack_pointer, na);
- } else {
- x = do_call(func, &stack_pointer,
- na, nk);
- }
} else {
if (PyMethod_Check(func)
&& PyMethod_GET_SELF(func) != NULL) {