diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-06 17:57:29 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-06 17:57:29 (GMT) |
commit | 7a07e451a4f0a7c5b68af76f5ac6a6b1c2b10210 (patch) | |
tree | 3155f344653302987fe0e8bb4bf0c3b92d2a73ba /Objects/object.c | |
parent | 95701bdf40a00b3eb38aa4270b512ebac12fd87b (diff) | |
download | cpython-7a07e451a4f0a7c5b68af76f5ac6a6b1c2b10210.zip cpython-7a07e451a4f0a7c5b68af76f5ac6a6b1c2b10210.tar.gz cpython-7a07e451a4f0a7c5b68af76f5ac6a6b1c2b10210.tar.bz2 |
Issue #19512: Py_ReprEnter() and Py_ReprLeave() now use an identifier for the
"Py_Repr" dictionary key
Diffstat (limited to 'Objects/object.c')
-rw-r--r-- | Objects/object.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/object.c b/Objects/object.c index 95a5334..8078623 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1969,7 +1969,7 @@ _PyObject_DebugTypeStats(FILE *out) See dictobject.c and listobject.c for examples of use. */ -#define KEY "Py_Repr" +_Py_IDENTIFIER(Py_Repr); int Py_ReprEnter(PyObject *obj) @@ -1981,12 +1981,12 @@ Py_ReprEnter(PyObject *obj) dict = PyThreadState_GetDict(); if (dict == NULL) return 0; - list = PyDict_GetItemString(dict, KEY); + list = _PyDict_GetItemId(dict, &PyId_Py_Repr); if (list == NULL) { list = PyList_New(0); if (list == NULL) return -1; - if (PyDict_SetItemString(dict, KEY, list) < 0) + if (_PyDict_SetItemId(dict, &PyId_Py_Repr, list) < 0) return -1; Py_DECREF(list); } @@ -2014,7 +2014,7 @@ Py_ReprLeave(PyObject *obj) if (dict == NULL) goto finally; - list = PyDict_GetItemString(dict, KEY); + list = _PyDict_GetItemId(dict, &PyId_Py_Repr); if (list == NULL || !PyList_Check(list)) goto finally; |