From 4e59cf3ea6c3cbf6bab589301b8be8e2600d44ca Mon Sep 17 00:00:00 2001 From: Dan Palmer Date: Wed, 30 May 2018 14:50:22 +0100 Subject: [PATCH] Fix warning output Warning filtering is the responsibility of the application, not a library, and this current use causes all warnings from an application (at least those after this function is evaluated the first time) to print their contents. This makes the library a better citizen in the Python ecosystem, and more closely matches what developers would expect. (For what it's worth, we also can't start using this library without this patch because the logging is too verbose and may obscure more important warnings. We depend on being able to accurately control warning and logging output) --- graphene/utils/deprecated.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/graphene/utils/deprecated.py b/graphene/utils/deprecated.py index f70b2e7d..d00642f8 100644 --- a/graphene/utils/deprecated.py +++ b/graphene/utils/deprecated.py @@ -6,13 +6,11 @@ string_types = (type(b''), type(u'')) def warn_deprecation(text): - warnings.simplefilter('always', DeprecationWarning) warnings.warn( text, category=DeprecationWarning, stacklevel=2 ) - warnings.simplefilter('default', DeprecationWarning) def deprecated(reason):