PEP 587: Fix warnings options priority

This commit is contained in:
Victor Stinner 2019-09-30 02:18:59 +02:00
parent bddf666fa9
commit 16bc2821ee
1 changed files with 6 additions and 5 deletions

View File

@ -981,11 +981,12 @@ Priority of configuration parameters, highest to lowest:
Priority of warning options, highest to lowest:
* ``PyConfig.warnoptions``
* ``PyConfig.dev_mode`` (add ``"default"``)
* ``PYTHONWARNINGS`` environment variables
* ``-W WARNOPTION`` command line argument
* ``PyConfig.bytes_warning`` (add ``"error::BytesWarning"`` if greater
than 1, or add ``"default::BytesWarning``)
* ``PySys_AddWarnOption()``
* ``PyConfig.bytes_warning`` (add ``"error::BytesWarning"`` filter if
greater than 1, add ``"default::BytesWarning`` filter if equals to 1)
* ``-W opt`` command line argument
* ``PYTHONWARNINGS`` environment variable
* ``PyConfig.dev_mode`` (add ``"default"`` filter)
Rules on ``PyConfig`` parameters: