From 4a27c6910d047f412f83a6c2baba1a8530851cc1 Mon Sep 17 00:00:00 2001 From: Roi Agai Date: Wed, 4 Sep 2024 11:37:53 +0300 Subject: [PATCH] CR: cleanup in a newly finally block --- gprofiler/profilers/python_ebpf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gprofiler/profilers/python_ebpf.py b/gprofiler/profilers/python_ebpf.py index 5935e52f8..e34c674cd 100644 --- a/gprofiler/profilers/python_ebpf.py +++ b/gprofiler/profilers/python_ebpf.py @@ -188,11 +188,11 @@ def test(self) -> None: poll_process(process, self._POLL_TIMEOUT, self._profiler_state.stop_event) except TimeoutError: process.kill() - self._staticx_cleanup() raise else: - self._staticx_cleanup() self._check_output(process, self.output_path) + finally: + self._staticx_cleanup() def start(self) -> None: logger.info("Starting profiling of Python processes with PyPerf")