Skip to content

Commit

Permalink
importlib.abc deprecation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shatakshiiii committed Oct 10, 2023
1 parent 6fe4bf5 commit 329756e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ansible_navigator/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Constants for ansible-navigator."""
import importlib.resources as importlib_resources

from importlib.abc import Traversable
from ansible_navigator.utils.compatibility import Traversable


PKG_NAME: str = "ansible_navigator"
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_navigator/ui_framework/colorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
import logging
import re

from importlib.abc import Traversable
from itertools import chain

from ansible_navigator.tm_tokenize.grammars import Grammars
from ansible_navigator.tm_tokenize.region import Regions
from ansible_navigator.tm_tokenize.tokenize import tokenize
from ansible_navigator.utils.compatibility import Traversable

from .curses_defs import CursesLine
from .curses_defs import CursesLinePart
Expand Down
3 changes: 2 additions & 1 deletion src/ansible_navigator/ui_framework/ui_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Object to hold basic UI settings."""

from dataclasses import dataclass
from importlib.abc import Traversable

from ansible_navigator.utils.compatibility import Traversable


@dataclass
Expand Down
6 changes: 6 additions & 0 deletions src/ansible_navigator/utils/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@
import importlib_metadata
else:
import importlib.metadata as importlib_metadata


if sys.version_info < (3, 12):
from importlib.abc import Traversable
else:
from importlib.resources.abc import Traversable

0 comments on commit 329756e

Please sign in to comment.