From 626c703f97a621293e5e316b94ff91519ec87936 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 15 Jan 2025 09:53:03 +0000 Subject: [PATCH 1/3] fix ResourceLoader deprecation warning --- Lib/importlib/abc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py index bb2837d38d83f1..29f01f77eff4a0 100644 --- a/Lib/importlib/abc.py +++ b/Lib/importlib/abc.py @@ -74,7 +74,7 @@ def __init__(self): import warnings warnings.warn('importlib.abc.ResourceLoader is deprecated in ' 'favour of supporting resource loading through ' - 'importlib.resources.abc.ResourceReader.', + 'importlib.resources.abc.TraversableResources.', DeprecationWarning, stacklevel=2) super().__init__() From 2621241cee8da809ede544cfa1a1a2d72c1e86f1 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 15 Jan 2025 09:56:07 +0000 Subject: [PATCH 2/3] update doc --- Doc/library/importlib.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 9e088a598a6c08..5fd52f4ff695fd 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -307,7 +307,7 @@ ABC hierarchy:: Loaders that wish to support resource reading should implement a :meth:`get_resource_reader` method as specified by - :class:`importlib.resources.abc.ResourceReader`. + :class:`importlib.resources.abc.TraversableResources`. .. versionchanged:: 3.7 Introduced the optional :meth:`get_resource_reader` method. @@ -386,7 +386,7 @@ ABC hierarchy:: .. deprecated:: 3.7 This ABC is deprecated in favour of supporting resource loading - through :class:`importlib.resources.abc.ResourceReader`. + through :class:`importlib.resources.abc.TraversableResources`. .. abstractmethod:: get_data(path) From 100bcec96c486ae2fde95d20b3b63916f423549a Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 15 Jan 2025 13:44:26 +0000 Subject: [PATCH 3/3] Discard changes to Doc/library/importlib.rst --- Doc/library/importlib.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 5fd52f4ff695fd..9e088a598a6c08 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -307,7 +307,7 @@ ABC hierarchy:: Loaders that wish to support resource reading should implement a :meth:`get_resource_reader` method as specified by - :class:`importlib.resources.abc.TraversableResources`. + :class:`importlib.resources.abc.ResourceReader`. .. versionchanged:: 3.7 Introduced the optional :meth:`get_resource_reader` method. @@ -386,7 +386,7 @@ ABC hierarchy:: .. deprecated:: 3.7 This ABC is deprecated in favour of supporting resource loading - through :class:`importlib.resources.abc.TraversableResources`. + through :class:`importlib.resources.abc.ResourceReader`. .. abstractmethod:: get_data(path)