[Python-checkins] cpython (3.4): Issue #21073: explain why Py_ReprEnter() allows for a missing thread state.

antoine.pitrou python-checkins at python.org
Mon Mar 31 22:05:12 CEST 2014


http://hg.python.org/cpython/rev/c42cce290d50
changeset:   90076:c42cce290d50
branch:      3.4
parent:      90074:d6fa1b30cdac
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Mon Mar 31 22:04:38 2014 +0200
summary:
  Issue #21073: explain why Py_ReprEnter() allows for a missing thread state.

files:
  Objects/object.c |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Objects/object.c b/Objects/object.c
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1849,6 +1849,8 @@
     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);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list