From 7e3d678f36869544bb8ffac2d35da9379a16559e Mon Sep 17 00:00:00 2001 From: Ivan Yordanov Date: Wed, 25 Oct 2023 21:01:24 +0300 Subject: [PATCH] ci: format --- hooks/gen_docs/gen_docs_contributing.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hooks/gen_docs/gen_docs_contributing.py b/hooks/gen_docs/gen_docs_contributing.py index 4d8767e90..7970b192b 100644 --- a/hooks/gen_docs/gen_docs_contributing.py +++ b/hooks/gen_docs/gen_docs_contributing.py @@ -1,4 +1,4 @@ -"""Copies ``CONTROBUTING.md`` from root to the docs""" +"""Copies ``CONTROBUTING.md`` from root to the docs.""" import shutil from pathlib import Path from tempfile import TemporaryFile @@ -10,10 +10,12 @@ # Copy `CONTRIBUTING.md` into the equivalent file in the docs, # adding a comment at the top which notes that the file is generated -with TemporaryFile() as file_header: +with ( + TemporaryFile() as file_header, + DEST.open("w+b") as file_dest, + SOURCE.open("rb") as file_source, +): file_header.write(HEADER) file_header.seek(0) - with DEST.open("w+b") as file_dest: - with SOURCE.open("rb") as file_source: - shutil.copyfileobj(file_header, file_dest) - shutil.copyfileobj(file_source, file_dest) + shutil.copyfileobj(file_header, file_dest) + shutil.copyfileobj(file_source, file_dest)