Skip to content

Commit fc7bbeb

Browse files
committed
Disable debug dump for nondebug build.
1 parent 916a6f1 commit fc7bbeb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Objects/dictobject.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ ctrl_get_index(const group_control *g, uint8_t log2size, int pos)
570570
static void
571571
dump_dictkeys(PyDictKeysObject *dk)
572572
{
573+
#ifdef DEBUG_PYDICT
573574
fprintf(stderr, "dictkeys object %p\n", dk);
574575
fprintf(stderr, " kind=%d\n", dk->dk_kind);
575576
fprintf(stderr, " log2_size=%d\n", dk->dk_log2_size+3);
@@ -596,6 +597,7 @@ dump_dictkeys(PyDictKeysObject *dk)
596597
fprintf(stderr, " %d: key=%p h1=%x h2=%02x hash=%lx\n", i, ep->me_key, h1, h2, ep->me_hash);
597598
}
598599
fprintf(stderr, "\n");
600+
#endif
599601
}
600602

601603
int
@@ -3509,11 +3511,13 @@ PyDoc_STRVAR(items__doc__,
35093511
PyDoc_STRVAR(values__doc__,
35103512
"D.values() -> an object providing a view on D's values");
35113513

3514+
#ifdef DEBUG_PYDICT
35123515
static PyObject *dict_dump(PyDictObject *mp, PyObject *notused)
35133516
{
35143517
dump_dictkeys(mp->ma_keys);
35153518
Py_RETURN_NONE;
35163519
}
3520+
#endif
35173521

35183522
static PyMethodDef mapp_methods[] = {
35193523
DICT___CONTAINS___METHODDEF
@@ -3540,7 +3544,9 @@ static PyMethodDef mapp_methods[] = {
35403544
copy__doc__},
35413545
DICT___REVERSED___METHODDEF
35423546
{"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
3547+
#ifdef DEBUG_PYDICT
35433548
{"_dump", (PyCFunction)dict_dump, METH_NOARGS, PyDoc_STR("internal use only")},
3549+
#endif
35443550
{NULL, NULL} /* sentinel */
35453551
};
35463552

0 commit comments

Comments
 (0)