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 /Python/errors.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 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Python/errors.c b/Python/errors.c index 7b67566..5ff1e4c 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -152,13 +152,7 @@ PyErr_SetString(PyObject *exception, const char *string) PyObject * PyErr_Occurred(void) { - /* If there is no thread state, PyThreadState_GET calls - Py_FatalError, which calls PyErr_Occurred. To avoid the - resulting infinite loop, we inline PyThreadState_GET here and - treat no thread as no error. */ - PyThreadState *tstate = - ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)); - + PyThreadState *tstate = _PyThreadState_UncheckedGet(); return tstate == NULL ? NULL : tstate->curexc_type; } |