From 360a2529471557da41b1a41459f709f6cde05596 Mon Sep 17 00:00:00 2001 From: Duncan Macleod Date: Sat, 28 Oct 2023 01:14:25 +0100 Subject: [PATCH] omicron.utils: set OMICRON_HTML in get_omicron_version (#174) avoids https://git.ligo.org/virgo/virgoapp/Omicron/-/issues/81 --- omicron/utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/omicron/utils.py b/omicron/utils.py index 12a44f1..39562ab 100644 --- a/omicron/utils.py +++ b/omicron/utils.py @@ -24,6 +24,7 @@ import sys from pathlib import Path from shutil import which +from tempfile import gettempdir from packaging.version import Version @@ -98,10 +99,10 @@ def get_omicron_version(executable=None): executable = executable or find_omicron() try: return Version( - subprocess.check_output([ - executable, - "version", - ]).decode("utf-8").rsplit(maxsplit=1)[-1], + subprocess.check_output( + [executable, "version"], + env={"OMICRON_HTML": gettempdir()}, + ).decode("utf-8").rsplit(maxsplit=1)[-1], ) except subprocess.CalledProcessError as ex: raise RuntimeError(f"failed to determine omicron version from executable: {str(ex)}")