Skip to content

Commit 0a1b083

Browse files
committed
Replace fromisoformat with explicit construction of datetime
1 parent 8a00d13 commit 0a1b083

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

repo_config.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44
from os.path import dirname, abspath
55
import os
66

7+
try:
8+
from datetime import timezone
9+
utc = timezone.utc
10+
except ImportError:
11+
class UTC(datetime.tzinfo):
12+
def utcoffset(self, dt):
13+
return datetime.timedelta(0)
14+
def tzname(self, dt):
15+
return "UTC"
16+
def dst(self, dt):
17+
return datetime.timedelta(0)
18+
utc = UTC()
19+
720
GH_TOKEN = os.getenv("GH_TOKEN_FILE", "~/.github-token")
821
GH_TOKEN_READONLY = "~/.github-token-readonly"
922
CONFIG_DIR = dirname(abspath(__file__))
@@ -16,4 +29,4 @@
1629
IGNORE_ISSUES = {
1730
GH_CMSSW_ORGANIZATION + "/" + GH_CMSSW_REPO: [12368],
1831
}
19-
LEGACY_CATEGORIES = {"upgrade": datetime.datetime.fromisoformat("2025-10-10T00:00:00+00:00")}
32+
LEGACY_CATEGORIES = {"upgrade": datetime.datetime(2025, 10, 10, 0, 0, tzinfo=utc)}

0 commit comments

Comments
 (0)