Skip to content

Commit

Permalink
Switch to the new utils.deprecation spelling (#1140)
Browse files Browse the repository at this point in the history
* Switch to the new utils.deprecation spelling

The new spelling was introduced in
pyca/cryptography#6923 and is more friendly to
type checkers.

Version-wise, that PR appears to be in cryptography 37.0.0, which is now
beyond the minimum version for pyOpenSSL.

* reformat
  • Loading branch information
davidben authored Aug 13, 2022
1 parent 301e29a commit a145fc3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/OpenSSL/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3221,14 +3221,15 @@ def load_pkcs7_data(type: int, buffer: Union[str, bytes]) -> PKCS7:
return pypkcs7


load_pkcs7_data = utils.deprecated(
utils.deprecated(
load_pkcs7_data,
__name__,
(
"PKCS#7 support in pyOpenSSL is deprecated. You should use the APIs "
"in cryptography."
),
DeprecationWarning,
name="load_pkcs7_data",
)


Expand Down Expand Up @@ -3319,12 +3320,13 @@ def load_pkcs12(
return pkcs12


load_pkcs12 = utils.deprecated(
utils.deprecated(
load_pkcs12,
__name__,
(
"PKCS#12 support in pyOpenSSL is deprecated. You should use the APIs "
"in cryptography."
),
DeprecationWarning,
name="load_pkcs12",
)

0 comments on commit a145fc3

Please sign in to comment.