Utils.py 文件源码

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

项目:SoCFoundationFlow 作者: mattaw 项目源码 文件源码
def nogc(fun):
    """
    Decorator: let a function disable the garbage collector during its execution.
    It is used in the build context when storing/loading the build cache file (pickle)

    :param fun: function to execute
    :type fun: function
    :return: the return value of the function executed
    """
    def f(*k, **kw):
        try:
            gc.disable()
            ret = fun(*k, **kw)
        finally:
            gc.enable()
        return ret
    f.__doc__ = fun.__doc__
    return f
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号