diff --git a/hooks/gen_docs/utils.py b/hooks/gen_docs/utils.py index 36e2b6b9e..f171c71eb 100644 --- a/hooks/gen_docs/utils.py +++ b/hooks/gen_docs/utils.py @@ -19,7 +19,7 @@ def copy_file( :param dest: Path to new file :param add_header: Whether to add header, defaults to True :param header: Will be placed at the top of the file, defaults to - ``f"\n\n"`` + ``f""`` NOTE: The default header will only contain correct information if the caller of this function is the one which should be referenced in the header """ @@ -28,11 +28,10 @@ def copy_file( shutil.copyfileobj(file_source, file_dest) return if header is None: - header_encoded = f"\n\n" - else: - header_encoded = header + header = f"" with TemporaryFile(mode="w+") as file_header: - file_header.write(header_encoded) + file_header.write(header) + file_header.write("\n\n") file_header.seek(0) shutil.copyfileobj(file_header, file_dest) shutil.copyfileobj(file_source, file_dest)