aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-03-21 09:01:47 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2016-03-21 09:01:47 -0400
commit26af1f094ce27792ad6982633008d12e6c482f73 (patch)
tree983869e3b752a9b51ac40e993c9c1818f45ecc93 /src
parent2e820e2a9c43be843a31db10900f19f735b28232 (diff)
parentbeee981420164fb6f2a8e153081b261c11fddd99 (diff)
downloadcryptography-26af1f094ce27792ad6982633008d12e6c482f73.tar.gz
cryptography-26af1f094ce27792ad6982633008d12e6c482f73.tar.bz2
cryptography-26af1f094ce27792ad6982633008d12e6c482f73.zip
Merge pull request #2845 from Lukasa/issue/2844
Add __delattr__ to _ModuleWithDeprecations.
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
index 53795732..64a1c785 100644
--- a/src/cryptography/utils.py
+++ b/src/cryptography/utils.py
@@ -119,6 +119,13 @@ class _ModuleWithDeprecations(object):
def __setattr__(self, attr, value):
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):
return ["_module"] + dir(self._module)