Skip to content

Commit 18cb1bd

Browse files
authored
Merge pull request #252 from edly-io/maq/251
chore: Replace pkg_resource with importlib
2 parents 3761288 + c0ec060 commit 18cb1bd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

done/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
from .done import DoneXBlock
66

7-
__version__ = '2.3.0'
7+
__version__ = '2.4.0'

done/done.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import uuid
77

8-
import pkg_resources
8+
import importlib.resources
99
from web_fragments.fragment import Fragment
1010
from xblock.core import XBlock
1111
from xblock.fields import Boolean, DateTime, Float, Scope, String
@@ -26,8 +26,8 @@ def _(text):
2626

2727
def resource_string(path):
2828
"""Handy helper for getting resources from our kit."""
29-
data = pkg_resources.resource_string(__name__, path)
30-
return data.decode("utf8")
29+
data = importlib.resources.files(__package__).joinpath(path)
30+
return data.read_text(encoding="utf8")
3131

3232

3333
@XBlock.needs('i18n')

0 commit comments

Comments
 (0)