From: Victor Stinner <victor.stinner@gmail.com> Date: Wed, 6 Nov 2013 17:28:21 +0000 (+0100) Subject: Issue #19512: _print_total_refs() now uses an identifier to get "showrefcount" X-Git-Tag: v3.4.0b1~373 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ee41c5839b29226f2fc4893555638953f44c71f;p=python Issue #19512: _print_total_refs() now uses an identifier to get "showrefcount" key from sys._xoptions --- 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, "