summaryrefslogtreecommitdiff
path: root/Python/ceval.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 2770dc6d08..2bf64eda42 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -302,9 +302,7 @@ PyEval_ReleaseLock(void)
void
PyEval_AcquireThread(PyThreadState *tstate)
{
- if (tstate == NULL) {
- Py_FatalError("PyEval_AcquireThread: NULL new thread state");
- }
+ assert(tstate != NULL);
_PyRuntimeState *runtime = tstate->interp->runtime;
struct _ceval_runtime_state *ceval = &runtime->ceval;
@@ -321,9 +319,7 @@ PyEval_AcquireThread(PyThreadState *tstate)
void
PyEval_ReleaseThread(PyThreadState *tstate)
{
- if (tstate == NULL) {
- Py_FatalError("PyEval_ReleaseThread: NULL thread state");
- }
+ assert(tstate != NULL);
_PyRuntimeState *runtime = tstate->interp->runtime;
PyThreadState *new_tstate = _PyThreadState_Swap(&runtime->gilstate, NULL);
@@ -385,12 +381,10 @@ PyEval_SaveThread(void)
void
PyEval_RestoreThread(PyThreadState *tstate)
{
+ assert(tstate != NULL);
+
_PyRuntimeState *runtime = tstate->interp->runtime;
struct _ceval_runtime_state *ceval = &runtime->ceval;
-
- if (tstate == NULL) {
- Py_FatalError("PyEval_RestoreThread: NULL tstate");
- }
assert(gil_created(&ceval->gil));
int err = errno;