]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix the C definition of the sys._debugmallocstats() function: the function has
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 19 Dec 2013 16:16:42 +0000 (17:16 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 19 Dec 2013 16:16:42 +0000 (17:16 +0100)
no parameter

Lib/test/test_sys.py
Python/sysmodule.c

index 177b92ed70eee4a1e057a4a77df23905025744bb..7be8c9cdaaa94ef8c6408580d21a415e0b1de079 100644 (file)
@@ -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):
index d238561ecdb5c06512dfe3a5258bc71c85dbe8e6..cf580f104038bf18b63cbd44c59eb086baf4c6af 100644 (file)
@@ -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 */
 };