From 10bc5a951b70999a7bba5acc5495ed80087fc181 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 | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/galaxy/util/resources.py b/lib/galaxy/util/resources.py index 071921a68b77..ffaec3283b82 100644 --- a/lib/galaxy/util/resources.py +++ b/lib/galaxy/util/resources.py @@ -2,20 +2,16 @@ """ 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,