Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated pkg_resources package with importlib_resources #68

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openedxscorm/scormxblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from django.utils import timezone
from django.utils.module_loading import import_string
from webob import Response
import pkg_resources
import importlib_resources
from six import string_types

from web_fragments.fragment import Fragment
Expand Down Expand Up @@ -183,7 +183,7 @@ def get_current_user(self):
@staticmethod
def resource_string(path):
"""Handy helper for getting static resources from our kit."""
data = pkg_resources.resource_string(__name__, path)
data = importlib_resources.files(__package__).joinpath(path).read_bytes()
ahmed-arb marked this conversation as resolved.
Show resolved Hide resolved
return data.decode("utf8")

def author_view(self, context=None):
Expand Down