summaryrefslogtreecommitdiffstats
path: root/Python/errors.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-01-20 10:19:46 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-01-20 10:19:46 (GMT)
commitb56837a03358ee2a3374fc0004488179c6771442 (patch)
tree59d848efeabdc78d807d2eb3c462635f7cf3876a /Python/errors.c
parent5ccbf79eaea74814a16618879919ff470dc5131f (diff)
parentbfd316e750bc3040c08d1b5872e2de188e8c1e5f (diff)
downloadcpython-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.c8
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;
}