Return value: New reference.Given a module name (possibly of the form package.module) and a code object
read from a Python bytecode file or obtained from the built-in function
compile(), load the module. Return a new reference to the module object,
or NULL with an exception set if an error occurred. Before Python 2.4, the
module could still be created in error cases. Starting with Python 2.4, name
is removed from sys.modules in error cases, and even if name was already
in sys.modules on entry to PyImport_ExecCodeModule(). Leaving
incompletely initialized modules in sys.modules is dangerous, as imports of
such modules have no way to know that the module object is an unknown (and
probably damaged with respect to the module author’s intents) state.
The module’s __file__ attribute will be set to the code object’s
co_filename.
This function will reload the module if it was already imported. See
PyImport_ReloadModule() for the intended way to reload a module.
If name points to a dotted name of the form package.module, any package
structures not already created will still not be created.
Changed in version 2.4: name is removed from sys.modules in error cases.