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 c7a12fd
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/galaxy/util/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c7a12fd

Please sign in to comment.