diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-20 18:12:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-20 18:12:22 -0800 |
commit | 25420fe290b98171e6d30edf9350292c21ef700e (patch) | |
tree | 265d725ef6c341501f38873266c91e7461fd0364 /Objects/tupleobject.c | |
parent | 09f3a8a1249308a104a89041d82fe99e6c087043 (diff) | |
download | cpython-git-25420fe290b98171e6d30edf9350292c21ef700e.tar.gz |
bpo-32030: Add more options to _PyCoreConfig (#4485)
Py_Main() now handles two more -X options:
* -X showrefcount: new _PyCoreConfig.show_ref_count field
* -X showalloccount: new _PyCoreConfig.show_alloc_count field
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r-- | Objects/tupleobject.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 35decd8bb8..964db3bb8d 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -44,15 +44,10 @@ static Py_ssize_t count_tracked = 0; static void show_track(void) { - PyObject *xoptions, *value; - _Py_IDENTIFIER(showalloccount); - - xoptions = PySys_GetXOptions(); - if (xoptions == NULL) - return; - value = _PyDict_GetItemId(xoptions, &PyId_showalloccount); - if (value != Py_True) + PyInterpreterState *interp = PyThreadState_GET()->interp; + if (!inter->core_config.show_alloc_count) { return; + } fprintf(stderr, "Tuples created: %" PY_FORMAT_SIZE_T "d\n", count_tracked + count_untracked); |