From 00a976ebb6963bca8789e978c8a7be0d7c1243a1 Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Thu, 1 Feb 2024 08:25:09 -0800 Subject: [PATCH] lint --- examples/web-navigation/asyncio_nb_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/web-navigation/asyncio_nb_utils.py b/examples/web-navigation/asyncio_nb_utils.py index 287838fc4..a82f3712b 100644 --- a/examples/web-navigation/asyncio_nb_utils.py +++ b/examples/web-navigation/asyncio_nb_utils.py @@ -1,7 +1,11 @@ import asyncio +import logging import nest_asyncio +logger = logging.getLogger(__name__) + + def apply(): nest_asyncio.apply() @@ -16,10 +20,11 @@ def apply(): try: # invoke the original method... _original_del(self) - except: + except Exception as e: # type: ignore # ... but ignore any exceptions it might raise # NOTE: horrible anti-pattern. Just using because # jupyter notebooks don't play nice with asyncio + logger.debug(f"Exception in __del__ of {self}: {e}") pass # replace the original __del__ method