

def _load_class(modname, subname, classname):
    ' Loads the manifest and imports the module that contains the specified\n    type.\n\n    Logic is similar to that of roslib.message.get_message_class, but we want\n    more expressive exceptions.\n\n    Returns the loaded module, or None on failure '
    global loaded_modules
    try:
        with _manifest_lock:
            roslib.launcher.load_manifest(modname)
    except Exception as exc:
        raise InvalidPackageException(modname, exc)
    try:
        pypkg = __import__(('%s.%s' % (modname, subname)))
    except Exception as exc:
        raise InvalidModuleException(modname, subname, exc)
    try:
        return getattr(getattr(pypkg, subname), classname)
    except Exception as exc:
        raise InvalidClassException(modname, subname, pypkg, exc)

dataset/ETHPy150Open RobotWebTools/rosbridge_suite/rosbridge_library/src/rosbridge_library/internal/ros_loader.py _load_class/VarMisuse@125/250 `classname`->`pypkg`