job.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:DPQ 作者: DiggerPlus 项目源码 文件源码
def unpickle(pickled_string):
    """Unpickles a string, but raises a unified UnpickleError in case anything
    fails.

    This is a helper method to not have to deal with the fact that `loads()`
    potentially raises many types of exceptions (e.g. AttributeError,
    IndexError, TypeError, KeyError, etc.)
    """
    try:
        obj = loads(pickled_string)
    except (StandardError, UnpicklingError):
        raise UnpickleError('Could not unpickle.', pickled_string)
    return obj
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号