From 7df2f4b044b87afdd3201eb9619578c30663ede3 Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Tue, 3 Sep 2024 22:06:22 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20error,=20but=20remember=20that?= =?UTF-8?q?=20we=20didn=E2=80=99t=20find=20the=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Marr --- rebench/denoise.py | 2 +- rebench/denoise_client.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/rebench/denoise.py b/rebench/denoise.py index 56c75d39..00b31f87 100644 --- a/rebench/denoise.py +++ b/rebench/denoise.py @@ -106,7 +106,7 @@ def get_denoise_python_path(self): self._denoise_python_path = path return path - raise UIError("Could not determine the path to the rebench-denoise package from sys.path:" + str(sys.path), None) + self._denoise_python_path = False return self._denoise_python_path diff --git a/rebench/denoise_client.py b/rebench/denoise_client.py index 2bc4115c..f329b138 100644 --- a/rebench/denoise_client.py +++ b/rebench/denoise_client.py @@ -26,11 +26,17 @@ def _get_env_with_python_path_for_denoise(): def add_denoise_python_path_to_env(env): + path = paths.get_denoise_python_path() + + # did not find it, just leave the env unmodified + if path is False: + return env + env = env.copy() if 'PYTHONPATH' in env and env['PYTHONPATH']: - env['PYTHONPATH'] += os.pathsep + paths.get_denoise_python_path() + env['PYTHONPATH'] += os.pathsep + path else: - env['PYTHONPATH'] = paths.get_denoise_python_path() + env['PYTHONPATH'] = path return env