mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)
Fix warnings options priority: PyConfig.warnoptions has the highest
priority, as stated in the PEP 587.
* Document options order in PyConfig.warnoptions documentation.
* Make PyWideStringList_INIT macro private: replace "Py" prefix
with "_Py".
* test_embed: add test_init_warnoptions().
(cherry picked from commit fb4ae152a9
)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
This commit is contained in:
parent
19cd5951ec
commit
c9ed9e6fc7
10 changed files with 185 additions and 51 deletions
|
@ -2071,13 +2071,13 @@ _clear_preinit_entries(_Py_PreInitEntry *optionlist)
|
|||
|
||||
|
||||
PyStatus
|
||||
_PySys_ReadPreinitWarnOptions(PyConfig *config)
|
||||
_PySys_ReadPreinitWarnOptions(PyWideStringList *options)
|
||||
{
|
||||
PyStatus status;
|
||||
_Py_PreInitEntry entry;
|
||||
|
||||
for (entry = _preinit_warnoptions; entry != NULL; entry = entry->next) {
|
||||
status = PyWideStringList_Append(&config->warnoptions, entry->value);
|
||||
status = PyWideStringList_Append(options, entry->value);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue