From d4c55d1011f8b0385d25b62ac04710837ed8413e Mon Sep 17 00:00:00 2001 From: Kate Friedman Date: Fri, 19 Jan 2024 15:43:37 -0500 Subject: [PATCH] Update typing hint for WCOSS version of python (#2238) The typing hint `typing.List` was deprecated with python 3.9 in favor of using the primitive `list[str]`, but the functional version of python on WCOSS2 is <3.9, causing `setup_xml.py` to fail there. This replaces `list[str]` as a typing hint with the deprecated form until the supported version on WCOSS2 is >=3.9. --- workflow/rocoto/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow/rocoto/tasks.py b/workflow/rocoto/tasks.py index 8a40e645d0..d16a009eff 100644 --- a/workflow/rocoto/tasks.py +++ b/workflow/rocoto/tasks.py @@ -4,6 +4,7 @@ from applications.applications import AppConfig import rocoto.rocoto as rocoto from wxflow import Template, TemplateConstants, to_timedelta +from typing import List __all__ = ['Tasks'] @@ -124,7 +125,7 @@ def _template_to_rocoto_cycstring(self, template: str, subs_dict: dict = {}) -> rocoto_conversion_dict.get) @staticmethod - def _get_forecast_hours(cdump, config) -> list[str]: + def _get_forecast_hours(cdump, config) -> List[str]: fhmin = config['FHMIN'] fhmax = config['FHMAX'] fhout = config['FHOUT']