From 76e0d5d043e8a0a8f2b1c1129bd709a3f017bf30 Mon Sep 17 00:00:00 2001 From: birkholz-cubert Date: Thu, 26 Jun 2025 15:08:28 +0200 Subject: [PATCH] fix typing annotations for python 3.9 --- cuvis/General.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cuvis/General.py b/cuvis/General.py index 5ce9b6f..724cddb 100644 --- a/cuvis/General.py +++ b/cuvis/General.py @@ -5,15 +5,14 @@ from ._cuvis_il import cuvis_il from .cuvis_aux import SDKException -from .cuvis_types import ComponentType from pathlib import Path import cuvis.cuvis_types as internal -from dataclasses import dataclass +from typing import Union, Optional -def init(settings_path: str = ".", global_loglevel: int | str = logging.DEBUG, logfile_name: str | None = None): +def init(settings_path: str = ".", global_loglevel: Union[int, str] = logging.DEBUG, logfile_name: Optional[str] = None): if 'CUVIS_SETTINGS' in os.environ and settings_path == ".": # env variable is set and settings path is default kwarg settings_path = os.environ['CUVIS_SETTINGS'] @@ -45,7 +44,7 @@ def wrapper_version() -> str: return f'{pip_version} {git_hash}'.strip() -def set_log_level(lvl: int | str): +def set_log_level(lvl: Union[int, str]): if isinstance(lvl, str): # also support string as input argument