From 120b06f662dfb5ad03c4c5792c375823eb65323e Mon Sep 17 00:00:00 2001 From: David Erb Date: Wed, 21 Jun 2023 13:10:41 +0100 Subject: [PATCH] protect version import --- src/dls_servbase_lib/version.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dls_servbase_lib/version.py b/src/dls_servbase_lib/version.py index aeaaf82..9558be8 100644 --- a/src/dls_servbase_lib/version.py +++ b/src/dls_servbase_lib/version.py @@ -46,6 +46,14 @@ def meta(given_meta: Optional[dict] = None) -> dict: except Exception: meta["setproctitle"] = "unavailable" + try: + import aiohttp + + aiohttp.__version__ + meta["aiohttp"] = aiohttp.__version__ + except Exception: + meta["aiohttp"] = "unavailable" + if given_meta is not None: given_meta.update(meta) else: