Exemplo n.º 1
0
def get_pickleable_exception(exc):
    """Make sure exception is pickleable."""
    try:
        pickle.dumps(deepcopy(exc))
    except Exception:
        return UnpickleableExceptionWrapper.from_exception(exc)
    return exc
Exemplo n.º 2
0
 def test_init(self):
     x = UnpickleableExceptionWrapper('foo', 'Bar', [10, lambda x: x])
     assert x.exc_args
     assert len(x.exc_args) == 2
Exemplo n.º 3
0
 def test_init(self):
     x = UnpickleableExceptionWrapper('foo', 'Bar', [10, lambda x: x])
     self.assertTrue(x.exc_args)
     self.assertEqual(len(x.exc_args), 2)