summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-05-30 21:43:48 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2009-05-30 21:43:48 +0000
commit6987d541160ae69f896d0344f47230cbb12914e4 (patch)
tree28d9a025e4912f35c5edde16f89deb49d5d32f2e /Python
parent7e9d75a91d0127bbe2deb9f03f23895a9d77d19d (diff)
downloadcpython-git-6987d541160ae69f896d0344f47230cbb12914e4.tar.gz
Merged revisions 73064-73065 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73064 | antoine.pitrou | 2009-05-30 23:27:00 +0200 (sam., 30 mai 2009) | 4 lines Issue #5330: C functions called with keyword arguments were not reported by the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau. ........ r73065 | antoine.pitrou | 2009-05-30 23:39:25 +0200 (sam., 30 mai 2009) | 3 lines The test for #5330 wasn't correct. ........
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index bd35185c84..db454d52d0 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3911,10 +3911,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);
@@ -3999,10 +4006,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);