Skip to content
Snippets Groups Projects
Commit c8a45584 authored by Martin Mareš's avatar Martin Mareš
Browse files

unlink_if_exists je trefnější jméno

parent de374df3
Branches
No related tags found
1 merge request!21Reforma uploadů
......@@ -67,10 +67,10 @@ class TheJob:
job = self.job
if job.in_file is not None:
mo.util.unlink_if_needed(job_file_path(job.in_file))
mo.util.unlink_if_exists(job_file_path(job.in_file))
if job.out_file is not None:
mo.util.unlink_if_needed(job_file_path(job.out_file))
mo.util.unlink_if_exists(job_file_path(job.out_file))
sess.delete(job)
sess.commit()
......
......@@ -179,7 +179,7 @@ def link_to_dir(src: str, dest_dir: str, prefix: str = "", suffix: str = "") ->
logger.warning('Iteruji link_to_dir: %s už existuje', dest)
def unlink_if_needed(name: str):
def unlink_if_exists(name: str):
try:
os.unlink(name)
except FileNotFoundError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment