diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-02 17:55:46 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-02 21:28:53 -0500 |
commit | dc378d10347db0cd5d76108b041a42ca8512ab38 (patch) | |
tree | af201143976cbe07f0225a78603c10aeae4b2cb0 | |
parent | c9a879350d46581d69d51732d18579defd78072f (diff) | |
download | cryptography-dc378d10347db0cd5d76108b041a42ca8512ab38.tar.gz cryptography-dc378d10347db0cd5d76108b041a42ca8512ab38.tar.bz2 cryptography-dc378d10347db0cd5d76108b041a42ca8512ab38.zip |
move DeprecatedIn04 to utils, some kwargs changes
-rw-r--r-- | cryptography/exceptions.py | 3 | ||||
-rw-r--r-- | cryptography/hazmat/primitives/asymmetric/padding.py | 6 | ||||
-rw-r--r-- | cryptography/utils.py | 3 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_rsa.py | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/cryptography/exceptions.py b/cryptography/exceptions.py index b3c6ca7b..b4ee8feb 100644 --- a/cryptography/exceptions.py +++ b/cryptography/exceptions.py @@ -59,6 +59,3 @@ class InvalidKey(Exception): class InvalidToken(Exception): pass - - -DeprecatedIn04 = PendingDeprecationWarning diff --git a/cryptography/hazmat/primitives/asymmetric/padding.py b/cryptography/hazmat/primitives/asymmetric/padding.py index 932c2e29..72806a61 100644 --- a/cryptography/hazmat/primitives/asymmetric/padding.py +++ b/cryptography/hazmat/primitives/asymmetric/padding.py @@ -17,7 +17,7 @@ import warnings import six -from cryptography import exceptions, utils +from cryptography import utils from cryptography.hazmat.primitives import interfaces @@ -38,7 +38,7 @@ class PSS(object): warnings.warn( "salt_length is deprecated on MGF1 and should be added via the" " PSS constructor.", - exceptions.DeprecatedIn04 + utils.DeprecatedIn04 ) else: if (not isinstance(salt_length, six.integer_types) and @@ -67,7 +67,7 @@ class MGF1(object): warnings.warn( "salt_length is deprecated on MGF1 and should be passed to " "the PSS constructor instead.", - exceptions.DeprecatedIn04 + utils.DeprecatedIn04 ) if (not isinstance(salt_length, six.integer_types) and salt_length is not self.MAX_LENGTH): diff --git a/cryptography/utils.py b/cryptography/utils.py index eac833b6..5566d123 100644 --- a/cryptography/utils.py +++ b/cryptography/utils.py @@ -16,6 +16,9 @@ from __future__ import absolute_import, division, print_function import sys +DeprecatedIn04 = PendingDeprecationWarning + + def register_interface(iface): def register_decorator(klass): iface.register(klass) diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index e15108a9..fa0b5983 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -1128,7 +1128,7 @@ class TestPSS(object): def test_deprecation_warning(self): pytest.deprecated_call( padding.PSS, - padding.MGF1(hashes.SHA1(), 20) + mgf=padding.MGF1(hashes.SHA1(), 20) ) def test_invalid_salt_length_not_integer(self): @@ -1172,7 +1172,7 @@ class TestPSS(object): class TestMGF1(object): def test_deprecation_warning(self): pytest.deprecated_call( - padding.MGF1, hashes.SHA1(), 20 + padding.MGF1, algorithm=hashes.SHA1(), salt_length=20 ) def test_invalid_hash_algorithm(self): |