aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCory Benfield <lukasaoz@gmail.com>2016-03-21 11:38:04 +0000
committerCory Benfield <lukasaoz@gmail.com>2016-03-21 11:38:04 +0000
commit2d53db112cec047a7bf38896ddb32e71f60de2eb (patch)
tree50483a5e22bbe6844e3a7dc6275227e1b171d0d6
parentbb6997c45e24f4391ed89be08b258aef1f2d872f (diff)
downloadcryptography-2d53db112cec047a7bf38896ddb32e71f60de2eb.tar.gz
cryptography-2d53db112cec047a7bf38896ddb32e71f60de2eb.tar.bz2
cryptography-2d53db112cec047a7bf38896ddb32e71f60de2eb.zip
Warn when deleting deprecated attributes.
-rw-r--r--src/cryptography/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
index da7df76e..64a1c785 100644
--- a/src/cryptography/utils.py
+++ b/src/cryptography/utils.py
@@ -120,6 +120,10 @@ class _ModuleWithDeprecations(object):
setattr(self._module, attr, value)
def __delattr__(self, attr):
+ obj = getattr(self._module, attr)
+ if isinstance(obj, _DeprecatedValue):
+ warnings.warn(obj.message, obj.warning_class, stacklevel=2)
+
delattr(self._module, attr)
def __dir__(self):