Skip to content

Commit

Permalink
Fix DeprecationWarning for datetime.utcfromtimestamp in Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
jamate16 authored and casperdcl committed Feb 6, 2024
1 parent 6f13759 commit 48b2a0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tqdm/std.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
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
Expand Down Expand Up @@ -574,7 +574,7 @@ def format_meter(n, total, elapsed, ncols=None, prefix='', ascii=False, unit='it
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

Expand Down

0 comments on commit 48b2a0e

Please sign in to comment.