forked from github/pelican
Replace pytz dependency in tests (#3165)
This commit is contained in:
parent
0d1bcd4b11
commit
2eeff62fd7
4 changed files with 19 additions and 16 deletions
|
|
@ -9,9 +9,9 @@ from html import unescape
|
|||
from urllib.parse import unquote, urljoin, urlparse, urlunparse
|
||||
|
||||
try:
|
||||
import zoneinfo
|
||||
from zoneinfo import ZoneInfo
|
||||
except ModuleNotFoundError:
|
||||
from backports import zoneinfo
|
||||
from backports.zoneinfo import ZoneInfo
|
||||
|
||||
|
||||
from pelican.plugins import signals
|
||||
|
|
@ -127,7 +127,7 @@ class Content:
|
|||
# manage timezone
|
||||
default_timezone = settings.get("TIMEZONE", "UTC")
|
||||
timezone = getattr(self, "timezone", default_timezone)
|
||||
self.timezone = zoneinfo.ZoneInfo(timezone)
|
||||
self.timezone = ZoneInfo(timezone)
|
||||
|
||||
if hasattr(self, 'date'):
|
||||
self.date = set_date_tzinfo(self.date, timezone)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue