summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c10
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, "