Skip to content

Commit 1e5e490

Browse files
committed
Improve compatibility with older python.
According to python 3.11.0 changelog, "datetime.UTC" was added as an alias for "datetime.timezone.utc". git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1927318 13f79535-47bb-0310-9956-ffa450edef68
1 parent 0676967 commit 1e5e490

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/modules/md/test_710_profiles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_md_710_001(self, env):
5555
assert stat["profile"] == "default", f'{stat}'
5656
assert stat['cert']['rsa']['valid']['until'], f'{stat}'
5757
ts = email.utils.parsedate_to_datetime(stat['cert']['rsa']['valid']['until'])
58-
valid = ts - datetime.datetime.now(datetime.UTC)
58+
valid = ts - datetime.datetime.now(datetime.timezone.utc)
5959
assert valid.days in [89, 90]
6060

6161
# create a MD with 'shortlived' profile, get cert
@@ -79,7 +79,7 @@ def test_md_710_002(self, env):
7979
assert stat["profile"] == "shortlived", f'{stat}'
8080
assert stat['cert']['rsa']['valid']['until'], f'{stat}'
8181
ts = email.utils.parsedate_to_datetime(stat['cert']['rsa']['valid']['until'])
82-
valid = ts - datetime.datetime.now(datetime.UTC)
82+
valid = ts - datetime.datetime.now(datetime.timezone.utc)
8383
assert valid.days in [5, 6]
8484

8585
# create a MD with unknown 'XXX' profile, get cert

0 commit comments

Comments
 (0)