Skip to content

Commit

Permalink
Doc: C API: Fix Py_NewInterpreterFromConfig example code (python#12…
Browse files Browse the repository at this point in the history
  • Loading branch information
rhansen authored Nov 23, 2024
1 parent cc813e1 commit e3038e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e3038e9

Please sign in to comment.