Skip to content

Commit

Permalink
LIU-382: Demonstrate transition to importlib.resources
Browse files Browse the repository at this point in the history
  • Loading branch information
myxie committed Jun 10, 2024
1 parent 0291fe3 commit 418ff91
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions daliuge-translator/test/dropmake/test_pg_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@

import unittest

try:
from importlib.resources import files, as_file
except (ImportError, ModuleNotFoundError):
from importlib_resources import files

import pkg_resources
from dlg.common import CategoryType
from dlg.dropmake.lg import LG
Expand All @@ -33,9 +38,7 @@


def get_lg_fname(lg_name):
return pkg_resources.resource_filename(
__name__, "logical_graphs/{0}".format(lg_name)
) # @UndefinedVariable
return str(files(__package__) / f"logical_graphs/{lg_name}")


class TestPGGen(unittest.TestCase):
Expand Down

0 comments on commit 418ff91

Please sign in to comment.