Skip to content

Commit

Permalink
Avoid can't compare offset-naive and offset-aware datetimes in is_e…
Browse files Browse the repository at this point in the history
…xpired check for CachedResponse.
  • Loading branch information
shaked-seal committed Oct 27, 2024
1 parent 84651be commit 79257d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aiohttp_client_cache/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def host(self) -> str:
def is_expired(self) -> bool:
"""Determine if this cached response is expired"""
try:
return self.expires is not None and utcnow() > self.expires
return self.expires is not None and utcnow() > self.expires.replace(tzinfo=None)
except (AttributeError, TypeError, ValueError):
# Consider it expired and fetch a new response
return True
Expand Down

0 comments on commit 79257d9

Please sign in to comment.