py3: codecs.decode doesn't raise TypeError

`codecs.decode` doesn't raise `TypeError` in Python 3. Just obey the
comment!
This commit is contained in:
Ana Maria Martinez Gomez
2021-03-16 18:56:32 +01:00
parent 73a49c6a1f
commit 28406dafa1

View File

@@ -261,8 +261,7 @@ def parse_description(s, value_type, description=None):
if value_type == "bytes":
try:
value = codecs.decode(value.replace(" ", ""), "hex")
# TODO: Remove TypeError when Python2 is not used anymore
except (TypeError, binascii.Error):
except binascii.Error:
raise InvalidRule('unexpected bytes value: "%s", must be a valid hex sequence' % value)
if len(value) > MAX_BYTES_FEATURE_SIZE: