remove deprecated total_seconds
This commit is contained in:
parent
b7501776a1
commit
f8cdc78ce1
2 changed files with 2 additions and 22 deletions
|
|
@ -15,6 +15,8 @@ Unreleased
|
||||||
- ``json`` functions no longer take an ``encoding`` parameter.
|
- ``json`` functions no longer take an ``encoding`` parameter.
|
||||||
- ``safe_join`` is removed, use ``werkzeug.utils.safe_join``
|
- ``safe_join`` is removed, use ``werkzeug.utils.safe_join``
|
||||||
instead.
|
instead.
|
||||||
|
- ``total_seconds`` is removed, use ``timedelta.total_seconds``
|
||||||
|
instead.
|
||||||
|
|
||||||
|
|
||||||
Version 2.0.2
|
Version 2.0.2
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import sys
|
||||||
import typing as t
|
import typing as t
|
||||||
import warnings
|
import warnings
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from datetime import timedelta
|
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
from functools import update_wrapper
|
from functools import update_wrapper
|
||||||
from threading import RLock
|
from threading import RLock
|
||||||
|
|
@ -761,27 +760,6 @@ class locked_cached_property(werkzeug.utils.cached_property):
|
||||||
super().__delete__(obj)
|
super().__delete__(obj)
|
||||||
|
|
||||||
|
|
||||||
def total_seconds(td: timedelta) -> int:
|
|
||||||
"""Returns the total seconds from a timedelta object.
|
|
||||||
|
|
||||||
:param timedelta td: the timedelta to be converted in seconds
|
|
||||||
|
|
||||||
: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
|
|
||||||
|
|
||||||
|
|
||||||
def is_ip(value: str) -> bool:
|
def is_ip(value: str) -> bool:
|
||||||
"""Determine if the given string is an IP address.
|
"""Determine if the given string is an IP address.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue