[3.14] GH-137426: Remove code deprecation of importlib.abc.ResourceLoader (GH-137567) (#137654)

Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-08-12 14:47:28 +02:00 committed by GitHub
parent 946b226b90
commit daed07a1f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 38 deletions

View file

@ -64,21 +64,15 @@ def invalidate_caches(self):
class ResourceLoader(Loader):
"""Abstract base class for loaders which can return data from their
back-end storage.
back-end storage to facilitate reading data to perform an import.
This ABC represents one of the optional protocols specified by PEP 302.
For directly loading resources, use TraversableResources instead. This class
primarily exists for backwards compatibility with other ABCs in this module.
"""
def __init__(self):
import warnings
warnings.warn('importlib.abc.ResourceLoader is deprecated in '
'favour of supporting resource loading through '
'importlib.resources.abc.TraversableResources.',
DeprecationWarning, stacklevel=2)
super().__init__()
@abc.abstractmethod
def get_data(self, path):
"""Abstract method which when implemented should return the bytes for