Skip to content

Commit

Permalink
Merge pull request #252 from edly-io/maq/251
Browse files Browse the repository at this point in the history
chore: Replace pkg_resource with importlib
  • Loading branch information
farhan authored Aug 28, 2024
2 parents 3761288 + c0ec060 commit 18cb1bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion done/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

from .done import DoneXBlock

__version__ = '2.3.0'
__version__ = '2.4.0'
6 changes: 3 additions & 3 deletions done/done.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import uuid

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

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


@XBlock.needs('i18n')
Expand Down

0 comments on commit 18cb1bd

Please sign in to comment.