summaryrefslogtreecommitdiff
path: root/texgen.py
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-06-03 15:26:31 +0800
committerKeuin <[email protected]>2023-06-03 15:27:21 +0800
commitce55c5a37169fa2b3e17b53db8bcfe040aaa5cf0 (patch)
treebc00ee2830843eba8e70c2cdd9b19730bd4ce08b /texgen.py
parent1467767c8e26f2fe5d318114c8e0055be1c10c8e (diff)
Remove temporary files when done
Diffstat (limited to 'texgen.py')
-rw-r--r--texgen.py6
1 files 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