]> granicus.if.org Git - python/commitdiff
Issue #21073: explain why Py_ReprEnter() allows for a missing thread state.
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 31 Mar 2014 20:04:38 +0000 (22:04 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 31 Mar 2014 20:04:38 +0000 (22:04 +0200)
Objects/object.c

index c634e707ba1e7a101fec10c26ca487a3b0b07a30..a1a69fa123e68468be49d06a1999cfea190899eb 100644 (file)
@@ -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);