diff options
author | Victor Stinner <vstinner@python.org> | 2020-06-17 23:15:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-17 23:15:59 +0200 |
commit | 9e09849d20987c131b28bcdd252e53440d4cd1b3 (patch) | |
tree | 92d787be6889fe22f233f40f40556f66e89bac1d /Lib/test/test_importlib/test_spec.py | |
parent | 236a0f5cf022b59dbb6ea17a8e7a677c573d39b9 (diff) | |
download | cpython-9e09849d20987c131b28bcdd252e53440d4cd1b3.tar.gz cpython-9e09849d20987c131b28bcdd252e53440d4cd1b3.zip |
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.
Diffstat (limited to 'Lib/test/test_importlib/test_spec.py')
-rw-r--r-- | Lib/test/test_importlib/test_spec.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py index 5a16a03de60..20dacec8664 100644 --- a/Lib/test/test_importlib/test_spec.py +++ b/Lib/test/test_importlib/test_spec.py @@ -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) |