diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-06 18:28:21 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-06 18:28:21 +0100 |
commit | 43d34bd80f869e7121089a0e4d3b4b1e58453bb8 (patch) | |
tree | edbf0aa69227b91247cd1eb1e87ef07c1854e24a /Python/pythonrun.c | |
parent | 8bf32774bc8e990ca6e3a648cac9289d116caa13 (diff) | |
download | cpython-43d34bd80f869e7121089a0e4d3b4b1e58453bb8.tar.gz |
Issue #19512: _print_total_refs() now uses an identifier to get "showrefcount"
key from sys._xoptions
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 15a48f9947..dcd3664d14 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -38,15 +38,13 @@ #ifdef Py_REF_DEBUG static void _print_total_refs(void) { - PyObject *xoptions, *key, *value; + PyObject *xoptions, *value; + _Py_IDENTIFIER(showrefcount); + xoptions = PySys_GetXOptions(); if (xoptions == NULL) return; - key = PyUnicode_FromString("showrefcount"); - if (key == NULL) - return; - value = PyDict_GetItem(xoptions, key); - Py_DECREF(key); + value = _PyDict_GetItemId(xoptions, &PyId_showrefcount); if (value == Py_True) fprintf(stderr, "[%" PY_FORMAT_SIZE_T "d refs, " |