Skip to content

Commit

Permalink
update is_bad_headers deprecation message (#218)
Browse files Browse the repository at this point in the history
update is_bad_headers deprecation message
  • Loading branch information
davidism authored May 23, 2024
1 parent 56914a8 commit 7b450bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Unreleased
- Apply code formatting and linting tools.
- Deprecate the `__version__` attribute. Use feature detection or
`importlib.metadata.version("flask-mail")` instead.
- Indicate that the deprecated `is_bad_headers` will be removed in the next
version.


## Version 0.9.1
Expand Down
10 changes: 5 additions & 5 deletions src/flask_mail/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,12 @@ def has_bad_headers(self):
return False

def is_bad_headers(self):
from warnings import warn

msg = (
"is_bad_headers is deprecated, use the new has_bad_headers method instead."
warnings.warn(
"'is_bad_headers' is renamed to 'has_bad_headers'. The old name is"
" deprecated and will be removed in Flask-Mail 1.0.",
DeprecationWarning,
stacklevel=2,
)
warn(DeprecationWarning(msg), stacklevel=1)
return self.has_bad_headers()

def send(self, connection):
Expand Down

0 comments on commit 7b450bd

Please sign in to comment.