From bbe458a4b1f10596257edc1e9b621d0e8d023c20 Mon Sep 17 00:00:00 2001 From: Ingmar Splitt Date: Mon, 29 Apr 2024 20:10:30 +0200 Subject: [PATCH] Update shepherd_io.py --- software/python-package/shepherd_sheep/shepherd_io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/software/python-package/shepherd_sheep/shepherd_io.py b/software/python-package/shepherd_sheep/shepherd_io.py index bb17298a..8fcce8fb 100644 --- a/software/python-package/shepherd_sheep/shepherd_io.py +++ b/software/python-package/shepherd_sheep/shepherd_io.py @@ -8,7 +8,7 @@ import time from contextlib import suppress from types import TracebackType -from typing import Optional +from typing import Union from pydantic import validate_call from shepherd_core import CalibrationEmulator @@ -46,7 +46,7 @@ class ShepherdIOError(Exception): ID_TIMEOUT = 9999 - def __init__(self, message: str, id_num: int = 0, value: Optional[int, list] = 0) -> None: + def __init__(self, message: str, id_num: int = 0, value: Union[int, list, None] = 0) -> None: super().__init__(message + f" [id=0x{id_num:x}, val={value}]") self.id_num = id_num self.value = value