diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-10-30 23:15:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-30 23:15:12 (GMT) |
commit | 57dd11038f22379770d9f16e527f787fdea978fd (patch) | |
tree | 08c30a7056dbc972c7f9c9239928e208baca4073 /Python | |
parent | 5efe2eead3b385da4f838a9687b186b21dc01659 (diff) | |
download | cpython-57dd11038f22379770d9f16e527f787fdea978fd.zip cpython-57dd11038f22379770d9f16e527f787fdea978fd.tar.gz cpython-57dd11038f22379770d9f16e527f787fdea978fd.tar.bz2 |
[3.11] gh-96853: Restore test coverage for Py_Initialize(Ex) (GH-98874)
* As most of `test_embed` now uses `Py_InitializeFromConfig`, add
a specific test case to cover `Py_Initialize` (and `Py_InitializeEx`)
* Rename `_testembed` init helper to clarify the API used
* Add a `PyConfig_Clear` call in `Py_InitializeEx` to make
the code more obviously correct (it already didn't leak as
none of the dynamically allocated config fields were being
populated, but it's clearer if the wrappers follow the
documented API usage guidelines)
(cherry picked from commit 05e48865be69e1e5824f6915b588ff054717bb42)
Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pylifecycle.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 960a38a..0363e2e 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1289,6 +1289,7 @@ Py_InitializeEx(int install_sigs) config.install_signal_handlers = install_sigs; status = Py_InitializeFromConfig(&config); + PyConfig_Clear(&config); if (_PyStatus_EXCEPTION(status)) { Py_ExitStatusException(status); } |