Skip to content
Myr

remove deprecated total_seconds

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent b750177 · Browse files · 2 files+2 added−22 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−22 removed

  • other:+2 added−22 removed

2 files+2 added−22 removed

modified:src/flask/helpers.py-22 removed
3 unmodified lines
4import sys5import typing as t6import warnings7from datetime import datetime8from datetime import timedelta8from functools import lru_cache9from functools import update_wrapper10from threading import RLock11
747 unmodified lines
759 with self.lock:760 super().__delete__(obj)761762764def total_seconds(td: timedelta) -> int:765 """Returns the total seconds from a timedelta object.766767 :param timedelta td: the timedelta to be converted in seconds768769 :returns: number of seconds770 :rtype: int771772 .. deprecated:: 2.0773 Will be removed in Flask 2.1. Use774 :meth:`timedelta.total_seconds` instead.775 """776 warnings.warn(777 "'total_seconds' is deprecated and will be removed in Flask"778 " 2.1. Use 'timedelta.total_seconds' instead.",779 DeprecationWarning,780 stacklevel=2,781 )782 return td.days * 60 * 60 * 24 + td.seconds783784763def is_ip(value: str) -> bool:764 """Determine if the given string is an IP address.765766 :param value: value to check
24 unmodified lines
modified:CHANGES.rst+2 added
13 unmodified lines
14 ``config.from_file(name, load=json.load)``.15 - ``json`` functions no longer take an ``encoding`` parameter.16 - ``safe_join`` is removed, use ``werkzeug.utils.safe_join``17 instead.18 - ``total_seconds`` is removed, use ``timedelta.total_seconds``19 instead.202122Version 2.0.223-------------
1180 unmodified lines