File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -26,29 +26,26 @@ class DeserializationError(Exception):
2626 """Error during deserialization. """
2727
2828
29- class MetadataDeserializer ():
29+ class MetadataDeserializer (metaclass = abc . ABCMeta ):
3030 """Abstract base class for deserialization of Metadata objects. """
31- __metaclass__ = abc .ABCMeta
3231
3332 @abc .abstractmethod
3433 def deserialize (self , raw_data : bytes ) -> "Metadata" :
3534 """Deserialize passed bytes to Metadata object. """
3635 raise NotImplementedError
3736
3837
39- class MetadataSerializer ():
38+ class MetadataSerializer (metaclass = abc . ABCMeta ):
4039 """Abstract base class for serialization of Metadata objects. """
41- __metaclass__ = abc .ABCMeta
4240
4341 @abc .abstractmethod
4442 def serialize (self , metadata_obj : "Metadata" ) -> bytes :
4543 """Serialize passed Metadata object to bytes. """
4644 raise NotImplementedError
4745
4846
49- class SignedSerializer ():
47+ class SignedSerializer (metaclass = abc . ABCMeta ):
5048 """Abstract base class for serialization of Signed objects. """
51- __metaclass__ = abc .ABCMeta
5249
5350 @abc .abstractmethod
5451 def serialize (self , signed_obj : "Signed" ) -> bytes :
Original file line number Diff line number Diff line change 1010
1111"""
1212import json
13- import six
1413
1514from securesystemslib .formats import encode_canonical
1615
@@ -36,7 +35,7 @@ def deserialize(self, raw_data: bytes) -> Metadata:
3635 metadata_obj = Metadata .from_dict (json_dict )
3736
3837 except Exception as e : # pylint: disable=broad-except
39- six . raise_from ( DeserializationError , e )
38+ raise DeserializationError from e
4039
4140 return metadata_obj
4241
@@ -63,7 +62,7 @@ def serialize(self, metadata_obj: Metadata) -> bytes:
6362 sort_keys = True ).encode ("utf-8" )
6463
6564 except Exception as e : # pylint: disable=broad-except
66- six . raise_from ( SerializationError , e )
65+ raise SerializationError from e
6766
6867 return json_bytes
6968
@@ -78,6 +77,6 @@ def serialize(self, signed_obj: Signed) -> bytes:
7877 canonical_bytes = encode_canonical (signed_dict ).encode ("utf-8" )
7978
8079 except Exception as e : # pylint: disable=broad-except
81- six . raise_from ( SerializationError , e )
80+ raise SerializationError from e
8281
8382 return canonical_bytes
You can’t perform that action at this time.
0 commit comments