diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-06 17:28:21 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-06 17:28:21 (GMT) |
commit | 4ee41c5839b29226f2fc4893555638953f44c71f (patch) | |
tree | 80141c2fd476d9f3ac26703e6027f488a6bfccfe /Python | |
parent | d02fbb8f715a90079737e3048535b98c5a4e94e9 (diff) | |
download | cpython-4ee41c5839b29226f2fc4893555638953f44c71f.zip cpython-4ee41c5839b29226f2fc4893555638953f44c71f.tar.gz cpython-4ee41c5839b29226f2fc4893555638953f44c71f.tar.bz2 |
Issue #19512: _print_total_refs() now uses an identifier to get "showrefcount"
key from sys._xoptions
Diffstat (limited to 'Python')
-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 15a48f9..dcd3664 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, " |