From 7dad614367f72f0c99952c486b39eb1ed8aef600 Mon Sep 17 00:00:00 2001 From: Seth M Morton Date: Sat, 17 Nov 2018 18:10:49 -0800 Subject: Change recommendation about how to detect DeprecationWarnings If you turn DeprecationWarnings into errors, code can stop just due to python startup DeprectionWarnings - you'll never even get to your code! It's much better just to allow DeprecationWarnings to bubble up. --- README.rst | 7 ++++--- docs/intro.rst | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 5f30e8c..2d4b4bb 100644 --- a/README.rst +++ b/README.rst @@ -430,10 +430,11 @@ code with the following flag .. code-block:: console - $ python -Werror::DeprecationWarning my-code.py + $ python -Wdefault::DeprecationWarning my-code.py -This will turn any deprecation warnings into an error so that you can immediately -find old APIs. +By default ``DeprecationWarnings`` are not shown, but this will cause them to be shown. +Alternatively, you can just set the environment variable ``PYTHONWARNINGS`` to +"default::DeprecationWarning" and then run your code. Dropping Python 2.6 and 3.3 Support =================================== diff --git a/docs/intro.rst b/docs/intro.rst index 73635cd..03434f2 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -422,10 +422,11 @@ code with the following flag .. code-block:: console - $ python -Werror::DeprecationWarning my-code.py + $ python -Wdefault::DeprecationWarning my-code.py -This will turn any deprecation warnings into an error so that you can immediately -find old APIs. +By default :exc:`DeprecationWarnings` are not shown, but this will cause them to be shown. +Alternatively, you can just set the environment variable ``PYTHONWARNINGS`` to +"default::DeprecationWarning" and then run your code. Dropping Python 2.6 and 3.3 Support =================================== -- cgit v1.2.1