From 4a6fd4f690a4add231f4bef601521ed9bee513fb Mon Sep 17 00:00:00 2001 From: jamate Date: Wed, 4 Oct 2023 11:58:14 -0500 Subject: [PATCH] fix datetime.utcfromtimestamp py3.12 warning (#1519) --- tqdm/std.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tqdm/std.py b/tqdm/std.py index 897c1f5c..e58fdca9 100644 --- a/tqdm/std.py +++ b/tqdm/std.py @@ -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