mirror of
https://github.com/getpelican/pelican.git
synced 2026-10-07 20:06:55 +02:00
refactor: Upgrade code for Python 3.11 and above
This commit is contained in:
parent
68c341bd10
commit
74feb7c48b
5 changed files with 13 additions and 19 deletions
|
|
@ -2,12 +2,7 @@ import datetime
|
|||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
import tomllib
|
||||
else:
|
||||
import tomli as tomllib
|
||||
|
||||
import tomllib
|
||||
|
||||
sys.path.append(os.path.abspath(os.pardir))
|
||||
|
||||
|
|
@ -32,7 +27,7 @@ source_suffix = ".rst"
|
|||
master_doc = "index"
|
||||
project = project_data.get("name").upper()
|
||||
year = datetime.datetime.fromtimestamp(
|
||||
int(os.environ.get("SOURCE_DATE_EPOCH", time.time())), datetime.timezone.utc
|
||||
int(os.environ.get("SOURCE_DATE_EPOCH", time.time())), datetime.UTC
|
||||
).year
|
||||
project_copyright = f"2010–{year}" # noqa: RUF001
|
||||
exclude_patterns = ["_build"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue