summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 702e8f0..c5b4ac1 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1151,8 +1151,10 @@ static PyObject *
sys_debugmallocstats(PyObject *self, PyObject *args)
{
#ifdef WITH_PYMALLOC
- _PyObject_DebugMallocStats(stderr);
- fputc('\n', stderr);
+ if (_PyMem_PymallocEnabled()) {
+ _PyObject_DebugMallocStats(stderr);
+ fputc('\n', stderr);
+ }
#endif
_PyObject_DebugTypeStats(stderr);