From: Antoine Pitrou Date: Mon, 31 Mar 2014 20:04:38 +0000 (+0200) Subject: Issue #21073: explain why Py_ReprEnter() allows for a missing thread state. X-Git-Tag: v3.4.1rc1~148 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04d17d30b4cd8bc751055dade76179597513099d;p=python Issue #21073: explain why Py_ReprEnter() allows for a missing thread state. --- diff --git a/Objects/object.c b/Objects/object.c index c634e707ba..a1a69fa123 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1849,6 +1849,8 @@ Py_ReprEnter(PyObject *obj) Py_ssize_t i; dict = PyThreadState_GetDict(); + /* Ignore a missing thread-state, so that this function can be called + early on startup. */ if (dict == NULL) return 0; list = _PyDict_GetItemId(dict, &PyId_Py_Repr);