Skip to content

Commit

Permalink
do the formatting under try except block
Browse files Browse the repository at this point in the history
  • Loading branch information
iaacornus committed Aug 17, 2022
1 parent d3d8fdf commit 3ab8ca1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/utils/tex/sections/body.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,7 @@ def format_body(
ref: TextIO
with open(out_file, "r", encoding="utf-8") as ref:
ref_tex: list[str] = ref.readlines()
except (FileNotFoundError, OSError, PermissionError, IOError) as Err:
log.logger(
"E", f"{Err}. Cannot format the document, aborting ..."
)
else:

log.logger("I", "Formatting the document ...")

ignore: int = -1
Expand Down Expand Up @@ -224,7 +220,9 @@ def format_body(
break

continue

file.write(f"\t{line}")

file.write("\\end{document}")
except (FileNotFoundError, OSError, PermissionError, IOError) as Err:
log.logger(
"E", f"{Err}. Cannot format the document, aborting ..."
)

0 comments on commit 3ab8ca1

Please sign in to comment.