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().
diff --git a/Include/cpython/initconfig.h b/Include/cpython/initconfig.h
index d5effb8..8ce5622 100644
--- a/Include/cpython/initconfig.h
+++ b/Include/cpython/initconfig.h
@@ -220,7 +220,10 @@
wchar_t *program_name;
PyWideStringList xoptions; /* Command line -X options */
- PyWideStringList warnoptions; /* Warnings options */
+
+ /* Warnings options: lowest to highest priority. warnings.filters
+ is built in the reverse order (highest to lowest priority). */
+ PyWideStringList warnoptions;
/* If equal to zero, disable the import of the module site and the
site-dependent manipulations of sys.path that it entails. Also disable