[Python-checkins] r74140 - in python/branches/py3k: Objects/dictobject.c

benjamin.peterson python-checkins at python.org
Tue Jul 21 16:11:28 CEST 2009


Author: benjamin.peterson
Date: Tue Jul 21 16:11:27 2009
New Revision: 74140

Log:
Merged revisions 74139 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74139 | benjamin.peterson | 2009-07-21 09:08:40 -0500 (Tue, 21 Jul 2009) | 1 line
  
  must use _PyThreadState_Current so it isn't checked for NULL #6530
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Objects/dictobject.c

Modified: python/branches/py3k/Objects/dictobject.c
==============================================================================
--- python/branches/py3k/Objects/dictobject.c	(original)
+++ python/branches/py3k/Objects/dictobject.c	Tue Jul 21 16:11:27 2009
@@ -714,10 +714,12 @@
 		}
 	}
 
-	/* We can arrive here with a NULL tstate during initialization:
-	   try running "python -Wi" for an example related to string
-	   interning.  Let's just hope that no exception occurs then... */
-	tstate = PyThreadState_GET();
+	/* We can arrive here with a NULL tstate during initialization: try
+	   running "python -Wi" for an example related to string interning.
+	   Let's just hope that no exception occurs then...  This must be
+	   _PyThreadState_Current and not PyThreadState_GET() because in debug
+	   mode, it complains if tstate is NULL. */
+	tstate = _PyThreadState_Current;
 	if (tstate != NULL && tstate->curexc_type != NULL) {
 		/* preserve the existing exception */
 		PyObject *err_type, *err_value, *err_tb;


More information about the Python-checkins mailing list