public class _imp extends Object
Modifier and Type | Field and Description |
---|---|
static PyString |
__doc__ |
static int |
C_BUILTIN |
static int |
C_EXTENSION |
static int |
IMP_HOOK |
static int |
PKG_DIRECTORY |
static int |
PY_COMPILED |
static int |
PY_FROZEN |
static int |
PY_SOURCE |
Constructor and Description |
---|
_imp() |
Modifier and Type | Method and Description |
---|---|
static void |
acquire_lock()
Acquires the interpreter's import lock for the current thread.
|
static PyObject |
find_module(String name) |
static PyObject |
find_module(String name,
PyObject path) |
static PyObject |
get_magic() |
static PyObject |
get_suffixes() |
static boolean |
is_builtin(String name) |
static boolean |
is_frozen(String name) |
static PyObject |
load_compiled(String name,
PyString pathname)
Return a module with the given
name , the result of executing the compiled code
at the given pathname . |
static PyObject |
load_compiled(String name,
PyString pathname,
PyObject file)
Return a module with the given
name , the result of executing the compiled code
in the given file stream. |
static PyObject |
load_dynamic(String name,
String pathname) |
static PyObject |
load_dynamic(String name,
String pathname,
PyObject file) |
static PyObject |
load_module(String name,
PyObject file,
PyObject filename,
PyTuple data) |
static PyObject |
load_source(String modname,
String filename) |
static PyObject |
load_source(String modname,
String filename,
PyObject file) |
static boolean |
lock_held()
Return true if the import lock is currently held, else false.
|
static PyString |
makeCompiledFilename(PyString filename)
Variant of
imp.makeCompiledFilename(String) dealing with encoded bytes. |
static PyModule |
new_module(String name) |
static void |
release_lock()
Release the interpreter's import lock.
|
static PyObject |
reload(PyObject module) |
public static PyString __doc__
public static final int PY_SOURCE
public static final int PY_COMPILED
public static final int C_EXTENSION
public static final int PKG_DIRECTORY
public static final int C_BUILTIN
public static final int PY_FROZEN
public static final int IMP_HOOK
public static PyObject load_compiled(String name, PyString pathname)
name
, the result of executing the compiled code
at the given pathname
. If this path is a PyUnicode
, it is used
exactly; if it is a PyString
it is taken to be file-system encoded.name
- the module namepathname
- to the compiled module (becomes __file__
)name
public static PyObject load_compiled(String name, PyString pathname, PyObject file)
name
, the result of executing the compiled code
in the given file
stream.name
- the module namepathname
- a file path that is not null (becomes __file__
)file
- stream from which the compiled code is takenname
public static PyObject load_module(String name, PyObject file, PyObject filename, PyTuple data)
public static PyString makeCompiledFilename(PyString filename)
imp.makeCompiledFilename(String)
dealing with encoded bytes. In the context
where this is used from Python, a result in encoded bytes is preferable.public static PyObject get_magic()
public static PyObject get_suffixes()
public static boolean is_builtin(String name)
public static boolean is_frozen(String name)
public static void acquire_lock()
public static void release_lock()
public static boolean lock_held()