From 5d71aab9ecd67f2758308e663bd97e39275c8d99 Mon Sep 17 00:00:00 2001 From: Teodora Sechkova Date: Wed, 1 Sep 2021 17:37:03 +0300 Subject: [PATCH] Remove disable=broad-except The pylint warning W0703:broad-except was raised only when six was used and python 2 was still supported. The warning is no longer raised, the exceptions are handled/raised correctly and the disabling can be removed. Signed-off-by: Teodora Sechkova --- tuf/api/serialization/json.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tuf/api/serialization/json.py b/tuf/api/serialization/json.py index 3c223d00..43814993 100644 --- a/tuf/api/serialization/json.py +++ b/tuf/api/serialization/json.py @@ -36,7 +36,7 @@ def deserialize(self, raw_data: bytes) -> Metadata: json_dict = json.loads(raw_data.decode("utf-8")) metadata_obj = Metadata.from_dict(json_dict) - except Exception as e: # pylint: disable=broad-except + except Exception as e: raise DeserializationError from e return metadata_obj @@ -66,7 +66,7 @@ def serialize(self, metadata_obj: Metadata) -> bytes: sort_keys=True, ).encode("utf-8") - except Exception as e: # pylint: disable=broad-except + except Exception as e: raise SerializationError from e return json_bytes @@ -83,7 +83,7 @@ def serialize(self, signed_obj: Signed) -> bytes: signed_dict = signed_obj.to_dict() canonical_bytes = encode_canonical(signed_dict).encode("utf-8") - except Exception as e: # pylint: disable=broad-except + except Exception as e: raise SerializationError from e return canonical_bytes