summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-05-30 21:27:00 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-05-30 21:27:00 (GMT)
commit46dbe27f7e7a053c9b44155664dc02aa12b0717e (patch)
treebd0ae24121dc36127136a4885b6b50f4778bef08 /Python/ceval.c
parent2152ca390b80f9443997039bbbc55e19e9a2c6d8 (diff)
downloadcpython-46dbe27f7e7a053c9b44155664dc02aa12b0717e.zip
cpython-46dbe27f7e7a053c9b44155664dc02aa12b0717e.tar.gz
cpython-46dbe27f7e7a053c9b44155664dc02aa12b0717e.tar.bz2
Issue #5330: C functions called with keyword arguments were not reported by
the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 92021e6..dd91f5d 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4160,10 +4160,17 @@ do_call(PyObject *func, PyObject ***pp_stack, int na, int nk)
PCALL(PCALL_METHOD);
else if (PyType_Check(func))
PCALL(PCALL_TYPE);
+ else if (PyCFunction_Check(func))
+ PCALL(PCALL_CFUNCTION);
else
PCALL(PCALL_OTHER);
#endif
- result = PyObject_Call(func, callargs, kwdict);
+ if (PyCFunction_Check(func)) {
+ PyThreadState *tstate = PyThreadState_GET();
+ C_TRACE(result, PyCFunction_Call(func, callargs, kwdict));
+ }
+ else
+ result = PyObject_Call(func, callargs, kwdict);
call_fail:
Py_XDECREF(callargs);
Py_XDECREF(kwdict);
@@ -4248,10 +4255,17 @@ ext_do_call(PyObject *func, PyObject ***pp_stack, int flags, int na, int nk)
PCALL(PCALL_METHOD);
else if (PyType_Check(func))
PCALL(PCALL_TYPE);
+ else if (PyCFunction_Check(func))
+ PCALL(PCALL_CFUNCTION);
else
PCALL(PCALL_OTHER);
#endif
- result = PyObject_Call(func, callargs, kwdict);
+ if (PyCFunction_Check(func)) {
+ PyThreadState *tstate = PyThreadState_GET();
+ C_TRACE(result, PyCFunction_Call(func, callargs, kwdict));
+ }
+ else
+ result = PyObject_Call(func, callargs, kwdict);
ext_call_fail:
Py_XDECREF(callargs);
Py_XDECREF(kwdict);