]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-96853: Restore test coverage for Py_Initialize(Ex) (GH-98874)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 30 Oct 2022 23:15:12 +0000 (16:15 -0700)
committerGitHub <noreply@github.com>
Sun, 30 Oct 2022 23:15:12 +0000 (09:15 +1000)
commit57dd11038f22379770d9f16e527f787fdea978fd
tree08c30a7056dbc972c7f9c9239928e208baca4073
parent5efe2eead3b385da4f838a9687b186b21dc01659
[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>
Lib/test/test_embed.py
Misc/NEWS.d/next/C API/2022-10-16-15-00-25.gh-issue-96853.V0wiXP.rst [new file with mode: 0644]
Misc/NEWS.d/next/Tests/2022-10-12-14-57-06.gh-issue-96853.ANe-bw.rst [new file with mode: 0644]
Programs/_testembed.c
Python/pylifecycle.c