https://github.com/python/cpython/commit/b8786dc33b634946e5a295323e8cbc693e565ff8
commit: b8786dc33b634946e5a295323e8cbc693e565ff8
branch: main
author: U2A2U2A1 <[email protected]>
committer: FFY00 <[email protected]>
date: 2026-06-22T14:17:26Z
summary:

gh-151560: fix `AttributeError` when running 
`test.test_importlib.resources.test_resource` (#151561)

* [gh-151560]
import MetaPathFinder, Loader from importlib.abc
+ make it used

* sort import alphabetically

files:
M Lib/test/test_importlib/resources/util.py

diff --git a/Lib/test/test_importlib/resources/util.py 
b/Lib/test/test_importlib/resources/util.py
index 85b5c61518de444..e734746e9dcb3b8 100644
--- a/Lib/test/test_importlib/resources/util.py
+++ b/Lib/test/test_importlib/resources/util.py
@@ -6,6 +6,7 @@
 import pathlib
 import sys
 import types
+from importlib.abc import Loader, MetaPathFinder
 from importlib.machinery import ModuleSpec
 from importlib.resources.abc import ResourceReader, Traversable, 
TraversableResources
 
@@ -218,7 +219,7 @@ def augment_sys_metapath(self, module):
         yield
         sys.meta_path.remove(finder_instance)
 
-    class MemoryFinder(importlib.abc.MetaPathFinder):
+    class MemoryFinder(MetaPathFinder):
         def __init__(self, module):
             self._module = module
 
@@ -232,7 +233,7 @@ def find_spec(self, fullname, path, target=None):
                 is_package=True,
             )
 
-    class MemoryLoader(importlib.abc.Loader):
+    class MemoryLoader(Loader):
         def __init__(self, module):
             self._module = module
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to