[Python-checkins] cpython: Fix the C definition of the sys._debugmallocstats() function: the function has

victor.stinner python-checkins at python.org
Thu Dec 19 17:17:04 CET 2013


http://hg.python.org/cpython/rev/2b31b7eff99c
changeset: 88068:2b31b7eff99c
user: Victor Stinner <victor.stinner at gmail.com>
date: Thu Dec 19 17:16:42 2013 +0100
summary:
 Fix the C definition of the sys._debugmallocstats() function: the function has
no parameter
files:
 Lib/test/test_sys.py | 3 +++
 Python/sysmodule.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -665,6 +665,9 @@
 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
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1186,7 +1186,7 @@
 {"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 */
 };
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /