https://github.com/python/cpython/commit/e3038e976b25a58f512d8c7083a752c89436eb0d
commit: e3038e976b25a58f512d8c7083a752c89436eb0d
branch: main
author: Richard Hansen <[email protected]>
committer: Eclips4 <[email protected]>
date: 2024-11-23T21:47:08+02:00
summary:
Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (#126667)
files:
M Doc/c-api/init.rst
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 24d876d1f35506..970084ce91ab69 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -1738,7 +1738,11 @@ function. You can create and destroy them using the
following functions:
.check_multi_interp_extensions = 1,
.gil = PyInterpreterConfig_OWN_GIL,
};
- PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);
+ PyThreadState *tstate = NULL;
+ PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);
+ if (PyStatus_Exception(status)) {
+ Py_ExitStatusException(status);
+ }
Note that the config is used only briefly and does not get modified.
During initialization the config's values are converted into various
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]