summaryrefslogtreecommitdiffstats
path: root/Python/pylifecycle.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-10 22:49:16 (GMT)
committerGitHub <noreply@github.com>2020-03-10 22:49:16 (GMT)
commit4e53abb0f4773e1cce68a4f41ddbb43e74364c5f (patch)
tree355a5073945fa5045a4b1354f9468c589d6d9158 /Python/pylifecycle.c
parent88f82b2b9ea3514359cb6e3218121f75334063ac (diff)
downloadcpython-4e53abb0f4773e1cce68a4f41ddbb43e74364c5f.zip
cpython-4e53abb0f4773e1cce68a4f41ddbb43e74364c5f.tar.gz
cpython-4e53abb0f4773e1cce68a4f41ddbb43e74364c5f.tar.bz2
bpo-38631: _PyGILState_Init() returns PyStatus (GH-18908)
_PyGILState_Init() now returns PyStatus rather than calling Py_FatalError() on failure.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r--Python/pylifecycle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index d00bf82..bc32eff 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -551,7 +551,10 @@ pycore_create_interpreter(_PyRuntimeState *runtime,
_PyEval_FiniThreads(&runtime->ceval);
/* Auto-thread-state API */
- _PyGILState_Init(tstate);
+ status = _PyGILState_Init(tstate);
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
/* Create the GIL */
status = _PyEval_InitThreads(tstate);