From a98a05df84e9d5b2c6da04f69522b466483ee08e Mon Sep 17 00:00:00 2001 From: kaburagisec <135169292+kaburagisec@users.noreply.github.com> Date: Sun, 4 Oct 2026 21:32:01 +0700 Subject: [PATCH] refactor(uitls): Add future annotations import for improved type hinting --- onvif/utils/error_handlers.py | 2 ++ onvif/utils/exceptions.py | 4 +++- onvif/utils/zeep.py | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/onvif/utils/error_handlers.py b/onvif/utils/error_handlers.py index 213120d..f63f1c8 100644 --- a/onvif/utils/error_handlers.py +++ b/onvif/utils/error_handlers.py @@ -37,6 +37,8 @@ - `zeep.exceptions.Fault`: Base SOAP fault exception """ +from __future__ import annotations + import logging from collections.abc import Callable from typing import Any diff --git a/onvif/utils/exceptions.py b/onvif/utils/exceptions.py index cfbc058..3e8f4a7 100644 --- a/onvif/utils/exceptions.py +++ b/onvif/utils/exceptions.py @@ -1,5 +1,7 @@ """ONVIFOperationException: Enhanced exception wrapper for ONVIF operation failures.""" +from __future__ import annotations + import requests from zeep.exceptions import Fault @@ -86,7 +88,7 @@ class ONVIFOperationException(Exception): - `requests.exceptions.RequestException`: Base HTTP error """ - def __init__(self, operation, original_exception): + def __init__(self, operation: str, original_exception: Exception): self.operation = operation self.original_exception = original_exception diff --git a/onvif/utils/zeep.py b/onvif/utils/zeep.py index 2c30a75..847a699 100644 --- a/onvif/utils/zeep.py +++ b/onvif/utils/zeep.py @@ -1,5 +1,7 @@ """ZeepPatcher: Patch zeep SOAP library to handle ONVIF `xsd:any` fields.""" +from __future__ import annotations + import logging from collections.abc import Callable from typing import Any