cqlsh_copy_tests.py 文件源码

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

项目:cassandra-dtest 作者: apache 项目源码 文件源码
def get_temp_file(self, prefix=template, suffix=""):
        """
        On windows we cannot open temporary files after creating them unless we close them first.
        For this reason we must also create them with delete=False (or they would be deleted immediately when closed)
        and we want to make sure that the test object owns a reference to the file objects by adding them
        to self._tempfiles, so that they can be deleted when the test finishes.
        """
        ret = NamedTemporaryFile(delete=False, prefix=prefix, suffix=suffix)
        self._tempfiles.append(ret)
        if is_win():
            ret.close()
        return ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号