Merge pull request #1007 from alex/warning-stacklevel
Warn at the right stacklevel
diff --git a/cryptography/hazmat/primitives/asymmetric/padding.py b/cryptography/hazmat/primitives/asymmetric/padding.py
index dcc6fe0..f7710c4 100644
--- a/cryptography/hazmat/primitives/asymmetric/padding.py
+++ b/cryptography/hazmat/primitives/asymmetric/padding.py
@@ -38,7 +38,8 @@
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
@@ -80,7 +81,8 @@
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):