'Convert serialized exception to Python exception.'

def exception_to_python(self, exc):

    if exc:
        if (not isinstance(exc, BaseException)):
            exc_module = exc.get(u'exc_module')
            if (exc_module is None):
                cls = create_exception_cls(from_utf8(exc[u'exc_type']), __name__)
            else:
                exc_module = from_utf8(exc_module)
                exc_type = from_utf8(exc[u'exc_type'])
                cls = getattr(sys.modules[exc_module], exc_type)
            exc_msg = exc[u'exc_message']
            exc = cls(*(exc_msg if isinstance(exc_msg, tuple) else exc_msg))
        if (self.serializer in EXCEPTION_ABLE_CODECS):
            exc = get_pickled_exception(exc)
    return exc
