diff --git a/packages/syft/src/syft/service/request/request.py b/packages/syft/src/syft/service/request/request.py index 51b37efadfc..ea67f62bd06 100644 --- a/packages/syft/src/syft/service/request/request.py +++ b/packages/syft/src/syft/service/request/request.py @@ -1,5 +1,6 @@ # stdlib from collections.abc import Callable +from contextlib import suppress from enum import Enum import hashlib import inspect @@ -1106,10 +1107,8 @@ def type_for_field(object_type: type, attr_name: str) -> type | None: try: field_type = object_type.__dict__["__annotations__"][attr_name] except Exception: # nosec - try: + with suppress(Exception): # nosec field_type = object_type.__fields__.get(attr_name, None).type_ - except Exception: # nosec - pass return field_type