Skip to content

Commit

Permalink
Warn at the right stacklevel
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed May 3, 2014
1 parent bac18fc commit 18e036d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cryptography/hazmat/primitives/asymmetric/padding.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def __init__(self, mgf, salt_length=None):
warnings.warn(
"salt_length is deprecated on MGF1 and should be added via the"
" PSS constructor.",
utils.DeprecatedIn04
utils.DeprecatedIn04,
stacklevel=2
)
else:
if (not isinstance(salt_length, six.integer_types) and
Expand Down Expand Up @@ -80,7 +81,8 @@ def __init__(self, algorithm, salt_length=None):
warnings.warn(
"salt_length is deprecated on MGF1 and should be passed to "
"the PSS constructor instead.",
utils.DeprecatedIn04
utils.DeprecatedIn04,
stacklevel=2
)
if (not isinstance(salt_length, six.integer_types) and
salt_length is not self.MAX_LENGTH):
Expand Down

0 comments on commit 18e036d

Please sign in to comment.