From 6f1314730c7cc1a6e08524423d6b19abd081065f Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 25 Mar 2022 09:43:04 +0100 Subject: [PATCH] Stay with minversion 3.6 (and require module we already use elsewhere) Fixes #2770 --- osclib/stagingapi.py | 2 +- tests/OBSLocal.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osclib/stagingapi.py b/osclib/stagingapi.py index 83b2ced9..92f2d9cd 100644 --- a/osclib/stagingapi.py +++ b/osclib/stagingapi.py @@ -881,7 +881,7 @@ class StagingAPI(object): """ freezetime = attribute_value_load(self.apiurl, project, 'FreezeTime') if freezetime: - freezetime = datetime.fromisoformat(freezetime) + freezetime = dateutil.parser.isoparse(freezetime) tz_info = freezetime.tzinfo return (datetime.now(tz_info) - freezetime).total_seconds() / 3600 / 24 # fallback: old method diff --git a/tests/OBSLocal.py b/tests/OBSLocal.py index 1f5d725e..3d838ec4 100644 --- a/tests/OBSLocal.py +++ b/tests/OBSLocal.py @@ -152,7 +152,7 @@ class TestCase(unittest.TestCase): try: env = os.environ env['OSC_CONFIG'] = OSCRC - self.output = subprocess.check_output(args, stderr=subprocess.STDOUT, text=True, env=env) + self.output = subprocess.check_output(args, stderr=subprocess.STDOUT, universal_newlines=True, env=env) except subprocess.CalledProcessError as e: print(e.output) raise e