Skip to content

Commit 4e59cf3

Browse files
authored
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)
1 parent f13e54b commit 4e59cf3

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

graphene/utils/deprecated.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66

77

88
def warn_deprecation(text):
9-
warnings.simplefilter('always', DeprecationWarning)
109
warnings.warn(
1110
text,
1211
category=DeprecationWarning,
1312
stacklevel=2
1413
)
15-
warnings.simplefilter('default', DeprecationWarning)
1614

1715

1816
def deprecated(reason):

0 commit comments

Comments
 (0)