Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Aug 20, 2023
1 parent 8d38f87 commit aac549d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pytz/tzinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}


Expand All @@ -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
Expand Down

0 comments on commit aac549d

Please sign in to comment.