From 03ee39ab21d16857039cd11342728d2a16f4207b Mon Sep 17 00:00:00 2001 From: Jon Holba Date: Tue, 3 Dec 2024 13:49:21 +0100 Subject: [PATCH] Fix import that does not work in python 3.10 Replace UTC with timezone.utc --- src/ert/ensemble_evaluator/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ert/ensemble_evaluator/config.py b/src/ert/ensemble_evaluator/config.py index e2c4c63a285..14c40f1c511 100644 --- a/src/ert/ensemble_evaluator/config.py +++ b/src/ert/ensemble_evaluator/config.py @@ -8,7 +8,7 @@ import typing import warnings from base64 import b64encode -from datetime import UTC, datetime, timedelta +from datetime import datetime, timedelta, timezone from typing import Optional from cryptography import x509 @@ -71,8 +71,8 @@ def _generate_certificate( .issuer_name(issuer) .public_key(key.public_key()) .serial_number(x509.random_serial_number()) - .not_valid_before(datetime.now(UTC)) - .not_valid_after(datetime.now(UTC) + timedelta(days=365)) # 1 year + .not_valid_before(datetime.now(timezone.utc)) + .not_valid_after(datetime.now(timezone.utc) + timedelta(days=365)) # 1 year .add_extension( x509.SubjectAlternativeName( [