Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9d7c3cd

Browse files
committed
Merged revisions 74139 via svnmerge from
svn+ssh://[email protected]/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 ........
1 parent c883265 commit 9d7c3cd

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Objects/dictobject.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -714,10 +714,12 @@ PyDict_GetItem(PyObject *op, PyObject *key)
714714
}
715715
}
716716

717-
/* We can arrive here with a NULL tstate during initialization:
718-
try running "python -Wi" for an example related to string
719-
interning. Let's just hope that no exception occurs then... */
720-
tstate = PyThreadState_GET();
717+
/* We can arrive here with a NULL tstate during initialization: try
718+
running "python -Wi" for an example related to string interning.
719+
Let's just hope that no exception occurs then... This must be
720+
_PyThreadState_Current and not PyThreadState_GET() because in debug
721+
mode, it complains if tstate is NULL. */
722+
tstate = _PyThreadState_Current;
721723
if (tstate != NULL && tstate->curexc_type != NULL) {
722724
/* preserve the existing exception */
723725
PyObject *err_type, *err_value, *err_tb;

0 commit comments

Comments
 (0)