Skip to content

Commit aac549d

Browse files
committed
Fix tests
1 parent 8d38f87 commit aac549d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pytz/tzinfo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def memorized_timedelta(seconds):
2424
_timedelta_cache[seconds] = delta
2525
return delta
2626

27-
_epoch = datetime.fromtimestamp(0, tz=timezone.utc)
27+
_epoch = datetime.fromtimestamp(0, tz=timezone.utc).replace(tzinfo=None)
2828
_datetime_cache = {0: _epoch}
2929

3030

@@ -33,8 +33,8 @@ def memorized_datetime(seconds):
3333
try:
3434
return _datetime_cache[seconds]
3535
except KeyError:
36-
# NB. We can't just do datetime.fromtimestamp(seconds, tz=timezone.utc) as this
37-
# fails with negative values under Windows (Bug #90096)
36+
# NB. We can't just do datetime.fromtimestamp(seconds, tz=timezone.utc).replace(tzinfo=None)
37+
# as this fails with negative values under Windows (Bug #90096)
3838
dt = _epoch + timedelta(seconds=seconds)
3939
_datetime_cache[seconds] = dt
4040
return dt

0 commit comments

Comments
 (0)