Skip to content

Commit

Permalink
Merge pull request #92 from etzellux/remove-deprecated-importlib-fn
Browse files Browse the repository at this point in the history
Remove usage of deprecated importlib.resources functions
  • Loading branch information
fergalwalsh authored Feb 6, 2024
2 parents de87e0a + 72b2e3b commit 01ec3d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tealish/langspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def get_field_type(self, namespace: str, name: str) -> str:


packaged_lang_spec = LangSpec(
json.loads(importlib.resources.read_text(package=tealish, resource="langspec.json"))
json.loads(importlib.resources.files(tealish).joinpath("langspec.json").read_text())
)
packaged_lang_spec.is_packaged = True

Expand Down
18 changes: 9 additions & 9 deletions tealish/tx_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
if TYPE_CHECKING:
from .nodes import Node

with importlib.resources.path(tealish, "tealish_expressions.tx") as p:
tealish_mm = metamodel_from_file(
p,
use_regexp_group=True,
skipws=True,
ws=" \t",
debug=False,
classes=class_provider,
)
p = importlib.resources.files(tealish).joinpath("tealish_expressions.tx")
tealish_mm = metamodel_from_file(
p,
use_regexp_group=True,
skipws=True,
ws=" \t",
debug=False,
classes=class_provider,
)


def parse_expression(source: str) -> "Node":
Expand Down

0 comments on commit 01ec3d1

Please sign in to comment.