mirror of https://github.com/tqdm/tqdm.git
fix datetime.utcfromtimestamp py3.12 warning (#1519)
This commit is contained in:
parent
6f13759f4a
commit
4a6fd4f690
|
@ -10,7 +10,7 @@ Usage:
|
|||
import sys
|
||||
from collections import OrderedDict, defaultdict
|
||||
from contextlib import contextmanager
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from numbers import Number
|
||||
from time import time
|
||||
from warnings import warn
|
||||
|
@ -574,7 +574,7 @@ class tqdm(Comparable):
|
|||
remaining_str = tqdm.format_interval(remaining) if rate else '?'
|
||||
try:
|
||||
eta_dt = (datetime.now() + timedelta(seconds=remaining)
|
||||
if rate and total else datetime.utcfromtimestamp(0))
|
||||
if rate and total else datetime.fromtimestamp(0, timezone.utc))
|
||||
except OverflowError:
|
||||
eta_dt = datetime.max
|
||||
|
||||
|
|
Loading…
Reference in New Issue