Skip to content

Commit

Permalink
Sphinx may not generate an api folder
Browse files Browse the repository at this point in the history
Fix a bug for simple projects where sphinx does not generate a docs/build/html/api/ folder.  Without this fix the rename fails because the output_path does not exist.
  • Loading branch information
lod authored Jun 20, 2024
1 parent dca9625 commit 21ca88c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pydoctor/sphinx_ext/build_apidocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def on_build_finished(app: Sphinx, exception: Exception) -> None:

temp_path = output_path.with_suffix('.pydoctor_temp')
shutil.rmtree(sphinx_files, ignore_errors=True)
output_path.rename(sphinx_files)
if output_path.exists():
output_path.rename(sphinx_files)
temp_path.rename(output_path)


Expand Down

0 comments on commit 21ca88c

Please sign in to comment.