mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user