diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-07-21 14:08:40 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-07-21 14:08:40 (GMT) |
commit | 24d9175ebe6c6eba6d7c648112a25bc1c14f83c1 (patch) | |
tree | 3b98a806fa11e34e2ed7aded3f6b8fbfeb3a7efa /Objects/dictobject.c | |
parent | 6adda9641d41c858cfe2318f9e4e5b898ee1dce4 (diff) | |
download | cpython-24d9175ebe6c6eba6d7c648112a25bc1c14f83c1.zip cpython-24d9175ebe6c6eba6d7c648112a25bc1c14f83c1.tar.gz cpython-24d9175ebe6c6eba6d7c648112a25bc1c14f83c1.tar.bz2 |
must use _PyThreadState_Current so it isn't checked for NULL #6530
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index d797173..c4f93d4b 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -712,10 +712,12 @@ PyDict_GetItem(PyObject *op, PyObject *key) } } - /* 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; |