diff --git a/Python/sysmodule.c b/Python/sysmodule.c index c9bc4a3..24c4dcb 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -801,7 +801,7 @@ static PyObject * sys_call_tracing(PyObject *self, PyObject *args) { PyObject *func, *funcargs; - if (!PyArg_UnpackTuple(args, "call_tracing", 2, 2, &func, &funcargs)) + if (!PyArg_ParseTuple(args, "OO!:call_tracing", &func, &PyTuple_Type, &funcargs)) return NULL; return _PyEval_CallTracing(func, funcargs); } Index: Lib/test/test_sys.py =================================================================== --- Lib/test/test_sys.py (révision 77870) +++ Lib/test/test_sys.py (copie de travail) @@ -433,7 +433,11 @@ out = p.communicate()[0].strip() self.assertEqual(out, '?') + def test_call_tracing(self): + self.assertEqual(sys.call_tracing(str, (10,)), "10") + self.assertRaises(TypeError, sys.call_tracing, str, 10) + class SizeofTest(unittest.TestCase): TPFLAGS_HAVE_GC = 1<<14