_file_io.py 文件源码

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

项目:trio 作者: python-trio 项目源码 文件源码
def aclose(self):
        """Like :meth:`io.IOBase.close`, but async.

        This is also shielded from cancellation; if a cancellation scope is
        cancelled, the wrapped file object will still be safely closed.

        """

        # ensure the underling file is closed during cancellation
        with _core.open_cancel_scope(shield=True):
            await trio.run_sync_in_worker_thread(self._wrapped.close)

        await _core.checkpoint_if_cancelled()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号