diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-09-29 23:58:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-29 23:58:57 (GMT) |
commit | c9ed9e6fc76323ed537fb79d4232bcd27d82c57e (patch) | |
tree | 32a06498ac936f1d1fded02332c6b5026b59032b /Python/sysmodule.c | |
parent | 19cd5951ec4480c7cfcbcc379b36902312cfb8b8 (diff) | |
download | cpython-c9ed9e6fc76323ed537fb79d4232bcd27d82c57e.zip cpython-c9ed9e6fc76323ed537fb79d4232bcd27d82c57e.tar.gz cpython-c9ed9e6fc76323ed537fb79d4232bcd27d82c57e.tar.bz2 |
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 fb4ae152a9930f0e00cae8b2807f534058cf341a)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 5175158..5b0fb81 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -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; } |