Skip to content

Commit

Permalink
Simplify FlagList sdproperty registration
Browse files Browse the repository at this point in the history
  • Loading branch information
dkg committed Jun 15, 2023
1 parent 8869473 commit e028c80
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions pgpy/packet/subpackets/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,12 @@ class FlagList(Signature):
def flags(self):
return self._flags

@flags.register(list)
@flags.register(tuple)
def flags_list(self, val):
@flags.register
def flags_list(self, val: Union[list, tuple]):
self._flags = list(val)

@flags.register(int)
@flags.register(CompressionAlgorithm)
@flags.register(HashAlgorithm)
@flags.register(PubKeyAlgorithm)
@flags.register(SymmetricKeyAlgorithm)
def flags_int(self, val):
@flags.register
def flags_int(self, val: int):
if self.__flags__ is None: # pragma: no cover
raise AttributeError("Error: __flags__ not set!")

Expand Down

0 comments on commit e028c80

Please sign in to comment.