From d21e74700a5b236ea19981ff74724790a8bc4efc Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Fri, 5 Aug 2022 18:19:31 +0300 Subject: shielded some tasks --- kvmd/plugins/ugpio/otgconf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kvmd/plugins') diff --git a/kvmd/plugins/ugpio/otgconf.py b/kvmd/plugins/ugpio/otgconf.py index 8b888c8e..efe1b5c4 100644 --- a/kvmd/plugins/ugpio/otgconf.py +++ b/kvmd/plugins/ugpio/otgconf.py @@ -123,8 +123,10 @@ class Plugin(BaseUserGpioDriver): else: os.unlink(os.path.join(self.__profile_path, pin)) finally: - await asyncio.sleep(self.__init_delay) - self.__set_udc_enabled(True) + try: + await asyncio.sleep(self.__init_delay) + finally: + self.__set_udc_enabled(True) def __set_udc_enabled(self, enabled: bool) -> None: with open(self.__udc_path, "w") as udc_file: -- cgit v1.2.3