From ce55c5a37169fa2b3e17b53db8bcfe040aaa5cf0 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 3 Jun 2023 15:26:31 +0800 Subject: Remove temporary files when done --- texgen.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/texgen.py b/texgen.py index f629094..f90d917 100644 --- a/texgen.py +++ b/texgen.py @@ -13,8 +13,7 @@ def temp_dir(path: str): try: yield path finally: - # shutil.rmtree(path) - pass + shutil.rmtree(path) class TexGenerationError(Exception): @@ -62,6 +61,5 @@ class TexGenerator: print('STDERR', stderr) if proc.returncode != 0: raise TexGenerationError(f'xelatex process exited with non-zero code {proc.returncode}') - - os.rename(os.path.join(workdir, f'{job_name}.pdf'), cache_file_path) + os.rename(os.path.join(workdir, f'{job_name}.pdf'), cache_file_path) return cache_file_path -- cgit v1.2.3