From: Rainer Jung Date: Fri, 18 Jul 2025 17:07:05 +0000 (+0000) Subject: Improve compatibility with older python. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1045f538cfba42142058a3b1b7a0957373cd62ff;p=thirdparty%2Fapache%2Fhttpd.git 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/trunk@1927317 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/modules/md/test_710_profiles.py b/test/modules/md/test_710_profiles.py index d8fc1a4adc..2fbcf267ae 100644 --- a/test/modules/md/test_710_profiles.py +++ b/test/modules/md/test_710_profiles.py @@ -55,7 +55,7 @@ class TestProfiles: assert stat["profile"] == "default", f'{stat}' assert stat['cert']['rsa']['valid']['until'], f'{stat}' ts = email.utils.parsedate_to_datetime(stat['cert']['rsa']['valid']['until']) - valid = ts - datetime.datetime.now(datetime.UTC) + valid = ts - datetime.datetime.now(datetime.timezone.utc) assert valid.days in [89, 90] # create a MD with 'shortlived' profile, get cert @@ -79,7 +79,7 @@ class TestProfiles: assert stat["profile"] == "shortlived", f'{stat}' assert stat['cert']['rsa']['valid']['until'], f'{stat}' ts = email.utils.parsedate_to_datetime(stat['cert']['rsa']['valid']['until']) - valid = ts - datetime.datetime.now(datetime.UTC) + valid = ts - datetime.datetime.now(datetime.timezone.utc) assert valid.days in [5, 6] # create a MD with unknown 'XXX' profile, get cert