mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-09 22:53:49 +08:00
refactor: use datetime.UTC alias instead of timezone.utc
Python 3.11 introduced datetime.UTC as a cleaner alias for datetime.timezone.utc. Both build.py and fetch_github_stars.py are updated to use the shorter form. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -4,7 +4,7 @@
|
||||
import json
|
||||
import re
|
||||
import shutil
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
from typing import TypedDict
|
||||
|
||||
@@ -189,7 +189,7 @@ def build(repo_root: str) -> None:
|
||||
total_entries=total_entries,
|
||||
total_categories=len(categories),
|
||||
repo_stars=repo_stars,
|
||||
build_date=datetime.now(timezone.utc).strftime("%B %d, %Y"),
|
||||
build_date=datetime.now(UTC).strftime("%B %d, %Y"),
|
||||
sponsors=sponsors,
|
||||
),
|
||||
encoding="utf-8",
|
||||
|
||||
Reference in New Issue
Block a user