mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03: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().
This commit is contained in:
parent
58498bc717
commit
fb4ae152a9
10 changed files with 185 additions and 51 deletions
|
|
@ -220,7 +220,10 @@ typedef struct {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ extern "C" {
|
|||
|
||||
/* --- PyWideStringList ------------------------------------------------ */
|
||||
|
||||
#define PyWideStringList_INIT (PyWideStringList){.length = 0, .items = NULL}
|
||||
#define _PyWideStringList_INIT (PyWideStringList){.length = 0, .items = NULL}
|
||||
|
||||
#ifndef NDEBUG
|
||||
PyAPI_FUNC(int) _PyWideStringList_CheckConsistency(const PyWideStringList *list);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ extern PyStatus _PySys_Create(
|
|||
PyThreadState *tstate,
|
||||
PyObject **sysmod_p);
|
||||
extern PyStatus _PySys_SetPreliminaryStderr(PyObject *sysdict);
|
||||
extern PyStatus _PySys_ReadPreinitWarnOptions(PyConfig *config);
|
||||
extern PyStatus _PySys_ReadPreinitWarnOptions(PyWideStringList *options);
|
||||
extern PyStatus _PySys_ReadPreinitXOptions(PyConfig *config);
|
||||
extern int _PySys_InitMain(
|
||||
_PyRuntimeState *runtime,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue