From aac549d15eea60f7976996567d3cd5e9eca92935 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sun, 20 Aug 2023 22:51:26 +0200 Subject: [PATCH] Fix tests --- src/pytz/tzinfo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pytz/tzinfo.py b/src/pytz/tzinfo.py index 5651518..6e20cb1 100644 --- a/src/pytz/tzinfo.py +++ b/src/pytz/tzinfo.py @@ -24,7 +24,7 @@ def memorized_timedelta(seconds): _timedelta_cache[seconds] = delta return delta -_epoch = datetime.fromtimestamp(0, tz=timezone.utc) +_epoch = datetime.fromtimestamp(0, tz=timezone.utc).replace(tzinfo=None) _datetime_cache = {0: _epoch} @@ -33,8 +33,8 @@ def memorized_datetime(seconds): try: return _datetime_cache[seconds] except KeyError: - # NB. We can't just do datetime.fromtimestamp(seconds, tz=timezone.utc) as this - # fails with negative values under Windows (Bug #90096) + # NB. We can't just do datetime.fromtimestamp(seconds, tz=timezone.utc).replace(tzinfo=None) + # as this fails with negative values under Windows (Bug #90096) dt = _epoch + timedelta(seconds=seconds) _datetime_cache[seconds] = dt return dt