Skip to content

Commit

Permalink
Replace deprecated pkg_resources package with importlib_resources (#68)
Browse files Browse the repository at this point in the history
* fix: remove pkg_resources for compatibility with python 3.12
  • Loading branch information
ahmed-arb committed Mar 18, 2024
1 parent f81b9e7 commit ff587d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openedxscorm/scormxblock.py
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(__name__).joinpath(path).read_bytes()
return data.decode("utf8")

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

0 comments on commit ff587d3

Please sign in to comment.