Lines Matching defs:imp

15 imp = warnings_helper.import_deprecated('imp')
24 imp.load_dynamic()."""
26 return unittest.skipIf(getattr(imp, 'load_dynamic', None) is None,
27 'imp.load_dynamic() required')(meth)
35 self.assertEqual(imp.lock_held(), expected,
36 "expected imp.lock_held() to be %r" % expected)
42 lock_held_at_start = imp.lock_held()
46 imp.acquire_lock()
50 imp.release_lock()
57 imp.release_lock()
78 with imp.find_module('module_' + mod, self.test_path)[0] as fd:
83 imp.find_module('badsyntax_pep3120', path)
87 fp, filename, info = imp.find_module('module_' + mod,
96 fp, filename, info = imp.find_module("tokenize")
110 file, filename, info = imp.find_module(temp_mod_name)
119 # Test cannot cover imp.load_compiled function.
165 file, filename, info = imp.find_module(temp_mod_name)
171 self.assertEqual(info[2], imp.PY_SOURCE)
173 mod = imp.load_module(temp_mod_name, file, filename, info)
178 mod = imp.load_source(temp_mod_name, temp_mod_name + '.py')
184 mod = imp.load_compiled(
186 imp.cache_from_source(temp_mod_name + '.py'))
195 package = imp.load_package(test_package_name, test_package_name)
208 imp.find_module, "badsyntax_pep3120", [path])
211 # Verify that the imp module can correctly load and find .py files
224 x = imp.find_module("os")
226 new_os = imp.load_module("os", *x)
233 # Issue 15828 picked up that the adapter between the old imp API
236 x = imp.find_module(example)
240 mod = imp.load_module(example, *x)
247 fileobj, pathname, description = imp.find_module(m)
249 mod0 = imp.load_dynamic(m, pathname)
250 mod1 = imp.load_dynamic('_testimportmultiple_foo', pathname)
251 mod2 = imp.load_dynamic('_testimportmultiple_bar', pathname)
256 imp.load_dynamic('nonexistent', pathname)
266 imp.load_dynamic(name, path)
273 # on the behalf of imp.load_dynamic().
276 found = imp.find_module(name)
279 if found[2][2] != imp.C_EXTENSION:
281 imp.load_module(name, None, *found[1:])
293 module = imp.load_dynamic(name, spec.origin)
313 imp.find_module, os_helper.TESTFN, ["."])
317 loader = imp._LoadSourceCompatibility('imp', imp.__file__,
318 open(imp.__file__, encoding="utf-8"))
319 loader.get_data(imp.__file__) # File should be closed
320 loader.get_data(imp.__file__) # Will need to create a newly opened file
329 imp.load_source(modname, __file__ + "\0")
333 # There shouldn't be an assertion failure in imp.create_dynamic(),
335 create_dynamic = support.get_attribute(imp, 'create_dynamic')
382 file, path, description = imp.find_module('mymod', path=['.'])
383 mod = imp.load_module('mymod', file, path, description)
418 """Very basic tests to make sure that imp.reload() operates just like
431 imp.reload(os)
436 imp.reload(time)
441 imp.reload(marshal)
451 imp.reload(parser)
457 tag = imp.get_tag()
467 self.assertEqual(imp.cache_from_source(path, True), expect)
478 self.assertEqual(imp.source_from_cache(path), expect)
488 self.assertRaises(ImportError, imp.NullImporter, name)