Use OsError alone
@@ -17,7 +17,7 @@ def safe_log_job(job_name, log_lines, temp, append=False):
log_path = get_job_logs_path(job_name, temp)
try:
_lock_log(log_path, log_lines, append=append)
- except (FileNotFoundError, OSError):
+ except OSError:
create_job_logs_path(job_name=job_name, temp=temp)
# Retry
_lock_log(log_path, log_lines, append=append)
@@ -27,7 +27,7 @@ def safe_log_experiment(experiment_name, log_lines, temp, append=False):
log_path = get_experiment_logs_path(experiment_name, temp)
try:
_lock_log(log_path, log_lines, append=append)
- except (FileNotFoundError, OSError):
+ except OSError:
create_experiment_logs_path(experiment_name=experiment_name, temp=temp)
# Retry
_lock_log(log_path, log_lines, append=append)
@@ -37,7 +37,7 @@ def safe_log_experiment_job(experiment_job_name, log_lines, temp, append=False):
log_path = get_experiment_job_logs_path(experiment_job_name, temp)
try:
_lock_log(log_path, log_lines, append=append)
- except (FileNotFoundError, OSError):
+ except OSError:
create_experiment_job_logs_path(experiment_job_name=experiment_job_name, temp=temp)
# Retry
_lock_log(log_path, log_lines, append=append)
