(name, package)
return _resolve_name(name[level:], package, level)
Resolve a relative module name to an absolute one.
Resolve a relative module name to an absolute one.
Resolve a relative module name to an absolute one .
def resolve_name(name, package):
    """Resolve a relative module name to an absolute one."""
    if not name.startswith('.'):
        return name
    elif not package:
        raise ImportError(f'no package specified for {repr(name)} '
                          '(required for relative module names)')
    level = 0
    for character in name:
        if character != '.':
            break
        level += 1
    return _resolve_name(name[level:], package, level)
def resolve_name ( name , package ) : if not name . startswith ( '.' ) : return name elif not package : raise ImportError ( f'no package specified for {repr(name)} ' '(required for relative module names)' ) level = 0 for character in name : if character != '.' : break level += 1 return _resolve_name ( name [ level : ] , package , level )