aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2017-11-10 23:19:05 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2017-11-11 12:19:05 +0800
commit270933c1a2afa0aa60409946bb7319d85fd60059 (patch)
treef5ff261a2dd5be46e812785d67f9322596b19792 /src
parentd2d800058f93f78e46afe504b5709b865b7af35d (diff)
downloadcryptography-270933c1a2afa0aa60409946bb7319d85fd60059.tar.gz
cryptography-270933c1a2afa0aa60409946bb7319d85fd60059.tar.bz2
cryptography-270933c1a2afa0aa60409946bb7319d85fd60059.zip
Use a different warning class so users get warnings (#4014)
* Use a different warning class so users get warnings * fixed tests * do our own warning class * typo * flake8
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/utils.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
index 382905c0..baa7b7a1 100644
--- a/src/cryptography/utils.py
+++ b/src/cryptography/utils.py
@@ -11,11 +11,17 @@ import sys
import warnings
+# We use a UserWarning subclass, instead of DeprecationWarning, because CPython
+# decided deprecation warnings should be invisble be default.
+class CryptographyDeprecationWarning(UserWarning):
+ pass
+
+
# Several APIs were deprecated with no specific end-of-life date because of the
# ubiquity of their use. They should not be removed until we agree on when that
# cycle ends.
-PersistentlyDeprecated = DeprecationWarning
-DeprecatedIn21 = DeprecationWarning
+PersistentlyDeprecated = CryptographyDeprecationWarning
+DeprecatedIn21 = CryptographyDeprecationWarning
def _check_bytes(name, value):