From: Victor Stinner Date: Thu, 19 Dec 2013 16:16:42 +0000 (+0100) Subject: Fix the C definition of the sys._debugmallocstats() function: the function has X-Git-Tag: v3.4.0b2~171 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed0b87d73c59f0cd1b02cdf5404898f9ca03cdfc;p=thirdparty%2FPython%2Fcpython.git Fix the C definition of the sys._debugmallocstats() function: the function has no parameter --- diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 177b92ed70ee..7be8c9cdaaa9 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -665,6 +665,9 @@ class SysModuleTest(unittest.TestCase): ret, out, err = assert_python_ok(*args) self.assertIn(b"free PyDictObjects", err) + # The function has no parameter + self.assertRaises(TypeError, sys._debugmallocstats, True) + @unittest.skipUnless(hasattr(sys, "getallocatedblocks"), "sys.getallocatedblocks unavailable on this build") def test_getallocatedblocks(self): diff --git a/Python/sysmodule.c b/Python/sysmodule.c index d238561ecdb5..cf580f104038 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1186,7 +1186,7 @@ static PyMethodDef sys_methods[] = { {"settrace", sys_settrace, METH_O, settrace_doc}, {"gettrace", sys_gettrace, METH_NOARGS, gettrace_doc}, {"call_tracing", sys_call_tracing, METH_VARARGS, call_tracing_doc}, - {"_debugmallocstats", sys_debugmallocstats, METH_VARARGS, + {"_debugmallocstats", sys_debugmallocstats, METH_NOARGS, debugmallocstats_doc}, {NULL, NULL} /* sentinel */ };