I'd expect there to be a `sys.modules[mod_name] = mod_name` line to be here as well so that other things can import this module.