From c7a12fd446fc583c014a7976f7e10b017822772d Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Sun, 17 Dec 2023 19:17:28 +0000 Subject: [PATCH] Workaround ``ImportError`` for ``importlib.resources.Anchor`` xref: https://github.com/python/cpython/issues/113238 --- lib/galaxy/util/resources.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/galaxy/util/resources.py b/lib/galaxy/util/resources.py index 071921a68b77..0e90245539bd 100644 --- a/lib/galaxy/util/resources.py +++ b/lib/galaxy/util/resources.py @@ -2,20 +2,17 @@ """ import sys -if sys.version_info >= (3, 12): - from importlib.resources import ( - Anchor, - as_file, - files, - ) - from importlib.resources.abc import Traversable -elif sys.version_info >= (3, 9): - from importlib.abc import Traversable +if sys.version_info >= (3, 9): from importlib.resources import ( as_file, files, Package as Anchor, ) + + if sys.version_info >= (3, 12): + from importlib.resources.abc import Traversable + else: + from importlib.abc import Traversable else: from importlib_resources import ( as_file,