diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-05-30 21:41:10 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-05-30 21:41:10 (GMT) |
commit | 8e124f32442e46caab9e221d941510485b6e669a (patch) | |
tree | 76b8cecf874b10f12729e7916ab84100743879b6 /Python/ceval.c | |
parent | c06de477a35669cac037b0bc92a28f9492d76015 (diff) | |
download | cpython-8e124f32442e46caab9e221d941510485b6e669a.zip cpython-8e124f32442e46caab9e221d941510485b6e669a.tar.gz cpython-8e124f32442e46caab9e221d941510485b6e669a.tar.bz2 |
Merged revisions 73064 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.
........
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index e693147..b5b5c27 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3951,10 +3951,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); @@ -4039,10 +4046,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); |