From 542618e3a20301d5c2c063285b926fff8898d020 Mon Sep 17 00:00:00 2001 From: Geoff Low Date: Wed, 17 Jul 2024 07:43:13 +1200 Subject: [PATCH] watch for match syntax for older versions --- rwslib/builders/common.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rwslib/builders/common.py b/rwslib/builders/common.py index ce37a1a..d716db1 100644 --- a/rwslib/builders/common.py +++ b/rwslib/builders/common.py @@ -17,11 +17,11 @@ def get_utc_date() -> datetime.datetime: """ Returns the UTC date as datetime.datetime object. """ - match platform.python_version_tuple(): - case ("3", "10", _): - utc_date = datetime.datetime.utcnow() - case _: - utc_date = datetime.datetime.now(datetime.UTC) + version = platform.python_version_tuple() + if int(version[1]) < 11: + utc_date = datetime.datetime.utcnow() + else: + utc_date = datetime.datetime.now(datetime.UTC) return utc_date