deprecate total_seconds
This commit is contained in:
parent
f3ed1322a6
commit
85b430a366
3 changed files with 13 additions and 2 deletions
|
|
@ -709,7 +709,17 @@ def total_seconds(td):
|
|||
|
||||
:returns: number of seconds
|
||||
:rtype: int
|
||||
|
||||
.. deprecated:: 2.0
|
||||
Will be removed in Flask 2.1. Use
|
||||
:meth:`timedelta.total_seconds` instead.
|
||||
"""
|
||||
warnings.warn(
|
||||
"'total_seconds' is deprecated and will be removed in Flask"
|
||||
" 2.1. Use 'timedelta.total_seconds' instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return td.days * 60 * 60 * 24 + td.seconds
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue