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