parse_numpy should also catch AttributeError.

This commit is contained in:
Fabio Manganiello 2023-10-12 03:23:34 +02:00
parent 12f38281e1
commit 8b9ac59167
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -46,8 +46,8 @@ class Message:
if isinstance(obj, (bytes, bytearray)): if isinstance(obj, (bytes, bytearray)):
return '0x' + ''.join([f'{x:02x}' for x in obj]) return '0x' + ''.join([f'{x:02x}' for x in obj])
if callable(obj): if callable(obj):
return '<function at {}.{}>'.format(obj.__module__, obj.__name__) return f'<function at {obj.__module__}.{obj.__name__}>'
except (ImportError, TypeError): except (AttributeError, ImportError, TypeError):
pass pass
return return