import importlib


def fix_module_name(module, cls):
    """
    Turns a.b._C.C into a.b.C if possible.

    :param module: the module
    :type module: str
    :param cls: the class name
    :type cls: str
    :return: the (potentially) updated tuple of module and class name
    """
    if module.split(".")[-1].startswith("_"):
        try:
            module_short = ".".join(module.split(".")[:-1])
            getattr(importlib.import_module(module_short), cls)
            module = module_short
        except Exception:
            pass
    return module, cls