From babb14288c901b68f553e38fc9d109a68556be8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Wed, 30 May 2018 14:03:59 +0200 Subject: [PATCH] Use contextlib.suppress() to suppress stuff in SupervisorLogMixin --- lib/tfw/mixins/supervisor_mixin.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/tfw/mixins/supervisor_mixin.py b/lib/tfw/mixins/supervisor_mixin.py index d005527..713f0da 100644 --- a/lib/tfw/mixins/supervisor_mixin.py +++ b/lib/tfw/mixins/supervisor_mixin.py @@ -45,8 +45,6 @@ class SupervisorLogMixin(SupervisorBaseMixin): def clear_logs(self, process_name): for logfile in ('stdout_logfile', 'stderr_logfile'): - try: + with suppress(FileNotFoundError): remove(self.supervisor.getProcessInfo(process_name)[logfile]) - except FileNotFoundError: - pass self.supervisor.clearProcessLogs(process_name)