Do not force DeprecationWarning to be displayed

This change removes a `warnings.simplefilter` call that forced
`DeprecationWarning` occurrences (whether they are generated by this
library or any other code) to be displayed to the user. This call caused
Jenkins Job Builder, for example, to display several developer-targeted
warnings that are not helpful to the final user.

According to the Python documentation:

> Warnings that are only of interest to the developer are ignored by
> default. […] Having certain warnings ignored by default is done to
> prevent a user from seeing warnings that are only of interest to the
> developer. […] While you as a developer want to be notified that your
> code is using a deprecated module, to a user this information is
> essentially noise and provides no benefit to them.

(https://docs.python.org/2/library/warnings.html#updating-code-for-new-versions-of-python)

Change-Id: I31d4c6bd494361aa153fd59e2ceb6bedccd280bc
This commit is contained in:
Jonathan Perret 2016-07-13 12:21:51 +02:00
parent 4d495afe74
commit 5cbdccfb81
1 changed files with 0 additions and 1 deletions

View File

@ -74,7 +74,6 @@ try:
except ImportError:
pass
warnings.simplefilter("default", DeprecationWarning)
if sys.version_info < (2, 7, 0):
warnings.warn("Support for python 2.6 is deprecated and will be removed.")