diff --git a/pasn1.py b/pasn1.py index 367fff4..d970c89 100644 --- a/pasn1.py +++ b/pasn1.py @@ -325,7 +325,7 @@ class ASN1Coder(object): tf = self._typemap[type(obj)] except KeyError: if self.coerce is None: - raise + raise TypeError('unhandled object: %s' % `obj`) tf, obj = self.coerce(obj) @@ -580,5 +580,7 @@ class TestCode(unittest.TestCase): self.assertEqual(ac.loads(es), v) self.assertIsInstance(es, bytes) + self.assertRaises(TypeError, dumps, o) + def test_loads(self): self.assertRaises(ValueError, loads, '\x00\x02\x00')