mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-41006: importlib.util no longer imports typing (GH-20938)
Create importlib._abc submodule to avoid importing typing when importlib.util is imported. Move Loader ABC into importlib._abc.
This commit is contained in:
parent
236a0f5cf0
commit
9e09849d20
4 changed files with 55 additions and 51 deletions
|
@ -650,8 +650,8 @@ class FactoryTests:
|
|||
# Need to use a circuitous route to get at importlib.machinery to make
|
||||
# sure the same class object is used in the isinstance() check as
|
||||
# would have been used to create the loader.
|
||||
self.assertIsInstance(spec.loader,
|
||||
self.util.abc.machinery.SourceFileLoader)
|
||||
SourceFileLoader = self.util.spec_from_file_location.__globals__['SourceFileLoader']
|
||||
self.assertIsInstance(spec.loader, SourceFileLoader)
|
||||
self.assertEqual(spec.loader.name, self.name)
|
||||
self.assertEqual(spec.loader.path, self.path)
|
||||
self.assertEqual(spec.origin, self.path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue