예제 #1
0
파일: tasks.py 프로젝트: jonozzz/iRack
def get_pickleable_exception(exc):
    """Make sure exception is pickleable."""
    try:
        pickle.dumps(deepcopy(exc))
    except Exception:
        return UnpickleableExceptionWrapper.from_exception(exc)
    return exc
예제 #2
0
 def test_init(self):
     x = UnpickleableExceptionWrapper('foo', 'Bar', [10, lambda x: x])
     assert x.exc_args
     assert len(x.exc_args) == 2
예제 #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)