示例#1
0
 def test_empty_string_for_dir(self):
     # The empty string from sys.path means to search in the cwd.
     finder = _bootstrap._FileFinder(u'', _bootstrap._SourceFinderDetails())
     with open(u'mod.py', u'w') as file:
         file.write(u"# test file for importlib_full")
     try:
         loader = finder.find_module(u'mod')
         self.assertTrue(hasattr(loader, u'load_module'))
     finally:
         os.unlink(u'mod.py')
 def find(self, path):
     finder = _bootstrap._FileFinder(path,
                                     _bootstrap._SourceFinderDetails(),
                                     _bootstrap._SourcelessFinderDetails())
     return finder.find_module(self.name)
示例#3
0
 def import_(self, root, module):
     finder = _bootstrap._FileFinder(root,
                                     _bootstrap._SourceFinderDetails(),
                                     _bootstrap._SourcelessFinderDetails())
     return finder.find_module(module)