Use contextlib.suppress() to suppress stuff in SupervisorLogMixin

This commit is contained in:
Kristóf Tóth 2018-05-30 14:03:59 +02:00
parent 3bb97a6dcc
commit babb14288c

View File

@ -45,8 +45,6 @@ class SupervisorLogMixin(SupervisorBaseMixin):
def clear_logs(self, process_name): def clear_logs(self, process_name):
for logfile in ('stdout_logfile', 'stderr_logfile'): for logfile in ('stdout_logfile', 'stderr_logfile'):
try: with suppress(FileNotFoundError):
remove(self.supervisor.getProcessInfo(process_name)[logfile]) remove(self.supervisor.getProcessInfo(process_name)[logfile])
except FileNotFoundError:
pass
self.supervisor.clearProcessLogs(process_name) self.supervisor.clearProcessLogs(process_name)