Skip to content

Commit

Permalink
feat: remove pkg_resourse
Browse files Browse the repository at this point in the history
  • Loading branch information
arbimaq committed Sep 9, 2024
1 parent fccdf30 commit 354f836
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion invideoquiz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"""
from .invideoquiz import InVideoQuizXBlock

__version__ = '1.6.0'
__version__ = '1.6.1'
6 changes: 3 additions & 3 deletions invideoquiz/invideoquiz.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json
import os

import pkg_resources
import importlib.resources

from xblock.core import XBlock
from xblock.fields import Scope
Expand All @@ -33,8 +33,8 @@ def get_resource_string(path):
Retrieve string contents for the file path
"""
path = os.path.join('public', path)
resource_string = pkg_resources.resource_string(__name__, path)
return resource_string.decode('utf8')
resource_string = importlib.resources.files(__package__).joinpath(path)
return resource_string.read_text(encoding='utf8')


class InVideoQuizXBlock(StudioEditableXBlockMixin, XBlock):
Expand Down

0 comments on commit 354f836

Please sign in to comment.