Skip to content

Commit

Permalink
Workaround ImportError for importlib.resources.Anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Dec 17, 2023
1 parent 0cee855 commit 10bc5a9
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/galaxy/util/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 10bc5a9

Please sign in to comment.