Commit 3fec24ef authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #21073: explain why Py_ReprEnter() allows for a missing thread state.

parents 934a2957 04d17d30
...@@ -1849,6 +1849,8 @@ Py_ReprEnter(PyObject *obj) ...@@ -1849,6 +1849,8 @@ Py_ReprEnter(PyObject *obj)
Py_ssize_t i; Py_ssize_t i;
dict = PyThreadState_GetDict(); dict = PyThreadState_GetDict();
/* Ignore a missing thread-state, so that this function can be called
early on startup. */
if (dict == NULL) if (dict == NULL)
return 0; return 0;
list = _PyDict_GetItemId(dict, &PyId_Py_Repr); list = _PyDict_GetItemId(dict, &PyId_Py_Repr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment