diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-01-20 10:19:46 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-01-20 10:19:46 (GMT) |
commit | b56837a03358ee2a3374fc0004488179c6771442 (patch) | |
tree | 59d848efeabdc78d807d2eb3c462635f7cf3876a /Objects/dictobject.c | |
parent | 5ccbf79eaea74814a16618879919ff470dc5131f (diff) | |
parent | bfd316e750bc3040c08d1b5872e2de188e8c1e5f (diff) | |
download | cpython-b56837a03358ee2a3374fc0004488179c6771442.zip cpython-b56837a03358ee2a3374fc0004488179c6771442.tar.gz cpython-b56837a03358ee2a3374fc0004488179c6771442.tar.bz2 |
Merge 3.5
Issue #26154: Add a new private _PyThreadState_UncheckedGet() function.
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 2475bf8..f6a98b4 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -1064,8 +1064,7 @@ PyDict_GetItem(PyObject *op, PyObject *key) Let's just hope that no exception occurs then... This must be _PyThreadState_Current and not PyThreadState_GET() because in debug mode, the latter complains if tstate is NULL. */ - tstate = (PyThreadState*)_Py_atomic_load_relaxed( - &_PyThreadState_Current); + tstate = _PyThreadState_UncheckedGet(); if (tstate != NULL && tstate->curexc_type != NULL) { /* preserve the existing exception */ PyObject *err_type, *err_value, *err_tb; @@ -1102,8 +1101,7 @@ _PyDict_GetItem_KnownHash(PyObject *op, PyObject *key, Py_hash_t hash) Let's just hope that no exception occurs then... This must be _PyThreadState_Current and not PyThreadState_GET() because in debug mode, the latter complains if tstate is NULL. */ - tstate = (PyThreadState*)_Py_atomic_load_relaxed( - &_PyThreadState_Current); + tstate = _PyThreadState_UncheckedGet(); if (tstate != NULL && tstate->curexc_type != NULL) { /* preserve the existing exception */ PyObject *err_type, *err_value, *err_tb; |