From 5e1cceb247ae6645032c9323548c91eacdd79b82 Mon Sep 17 00:00:00 2001 From: Dominik Haentsch Date: Tue, 13 Feb 2024 13:32:00 +0100 Subject: [PATCH 1/2] fix: unbound variables in reporting.py --- renumics/spotlight/reporting.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/renumics/spotlight/reporting.py b/renumics/spotlight/reporting.py index 84031fe0..b337af2a 100644 --- a/renumics/spotlight/reporting.py +++ b/renumics/spotlight/reporting.py @@ -60,9 +60,8 @@ def skip_analytics() -> bool: def _get_python_runtime() -> str: # try to determine what python runtime we are running in # plain python, ipython, ipython in colab, ipython in kaggle + python_runtime = "python" try: - python_runtime = "python" - try: ipython_kernel = get_ipython() # type:ignore python_runtime = "ipython" @@ -195,6 +194,8 @@ def emit_exception_event(path: Optional[str] = None) -> None: """ Emit an exception event. """ + logger.warning(f"emitted exception {path}") + _, exc, _ = sys.exc_info() if exc is None: return @@ -203,6 +204,8 @@ def emit_exception_event(path: Optional[str] = None) -> None: if path: detail = f"Path: {path}\n" + "\n\n".join(traceback_exc.format()) + else: + detail = "Path: None\n" + "\n\n".join(traceback_exc.format()) report_event( { From 5c94cf8dde8f8d9fc79e64317f9e46979371ee6b Mon Sep 17 00:00:00 2001 From: Dominik Haentsch Date: Tue, 13 Feb 2024 14:50:12 +0100 Subject: [PATCH 2/2] remove debug log --- renumics/spotlight/reporting.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/renumics/spotlight/reporting.py b/renumics/spotlight/reporting.py index b337af2a..2fd4207c 100644 --- a/renumics/spotlight/reporting.py +++ b/renumics/spotlight/reporting.py @@ -194,8 +194,6 @@ def emit_exception_event(path: Optional[str] = None) -> None: """ Emit an exception event. """ - logger.warning(f"emitted exception {path}") - _, exc, _ = sys.exc_info() if exc is None: return