diff --git a/docs/process_pages.py b/docs/process_pages.py index 00453632d896..72c0df3b6667 100644 --- a/docs/process_pages.py +++ b/docs/process_pages.py @@ -3,7 +3,6 @@ from collections import OrderedDict from pathlib import Path import subprocess -import os from entry_utilities import default_header_dict from entry_utilities import file_navigation_levels @@ -260,7 +259,7 @@ def AddPythonSnippetOutputs(file_path: Path) -> None: output_lines.append("```\n") # remove the temp file - os.remove(temp_file_path) + Path(temp_file_path).unlink() if is_existing_output_found: index += temp_index + lines[temp_index:].index("```\n") + 1