fix datetime.utcfromtimestamp py3.12 warning (#1519)

This commit is contained in:
jamate 2023-10-04 11:58:14 -05:00 committed by Casper da Costa-Luis
parent 6f13759f4a
commit 4a6fd4f690
No known key found for this signature in database
GPG Key ID: F5126E5FBD2512AD
1 changed files with 2 additions and 2 deletions

View File

@ -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