@classmethod
def find_spec(cls, fullname, path=None, target=None):
- if path is not None:
- return None
if _imp.is_builtin(fullname):
return spec_from_loader(fullname, cls, origin=cls._ORIGIN)
else:
spec = self.machinery.BuiltinImporter.find_spec(name)
self.assertIsNone(spec)
- def test_ignore_path(self):
- # The value for 'path' should always trigger a failed import.
- with util.uncache(util.BUILTINS.good_name):
- spec = self.machinery.BuiltinImporter.find_spec(util.BUILTINS.good_name,
- ['pkg'])
- self.assertIsNone(spec)
-
(Frozen_FindSpecTests,
Source_FindSpecTests
loader = self.machinery.BuiltinImporter.find_module('importlib')
self.assertIsNone(loader)
- def test_ignore_path(self):
- # The value for 'path' should always trigger a failed import.
- with util.uncache(util.BUILTINS.good_name):
- with warnings.catch_warnings():
- warnings.simplefilter("ignore", DeprecationWarning)
- loader = self.machinery.BuiltinImporter.find_module(
- util.BUILTINS.good_name,
- ['pkg'])
- self.assertIsNone(loader)
-
(Frozen_FinderTests,
Source_FinderTests