From ff587d323e48fd5d5541b560dc873168de7aed7b Mon Sep 17 00:00:00 2001 From: Ahmed Khalid <106074266+ahmed-arb@users.noreply.github.com> Date: Mon, 18 Mar 2024 10:01:05 +0500 Subject: [PATCH] Replace deprecated pkg_resources package with importlib_resources (#68) * fix: remove pkg_resources for compatibility with python 3.12 --- openedxscorm/scormxblock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openedxscorm/scormxblock.py b/openedxscorm/scormxblock.py index 5075c09..b7af42f 100644 --- a/openedxscorm/scormxblock.py +++ b/openedxscorm/scormxblock.py @@ -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 @@ -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):