diff --git a/aiokatcp/core.py b/aiokatcp/core.py index 289f219..7846514 100644 --- a/aiokatcp/core.py +++ b/aiokatcp/core.py @@ -379,10 +379,10 @@ def decode(cls: Any, value: bytes) -> Any: if len(values) == 1: return values[0] elif not values: - raise ValueError('None of the types in {} could decode {}'.format( + raise ValueError('None of the types in {} could decode {!r}'.format( cls, value)) else: - raise ValueError('{} is ambiguous for {}'.format(value, cls)) + raise ValueError('{!r} is ambiguous for {}'.format(value, cls)) else: return get_type(cls).decode(cls, value) diff --git a/aiokatcp/test/test_core.py b/aiokatcp/test/test_core.py index b9c6004..6589900 100644 --- a/aiokatcp/test/test_core.py +++ b/aiokatcp/test/test_core.py @@ -165,7 +165,7 @@ def test_unknown_class(self) -> None: def test_bad_raw(self) -> None: for type_, value in self.BAD_VALUES: with self.assertRaises(ValueError, - msg='{} should not be valid for {}'.format(value, type_)): + msg='{!r} should not be valid for {}'.format(value, type_)): decode(type_, value) @unittest.mock.patch('aiokatcp.core._types', []) # type: ignore