(name, package, level)
return '{}.{}'.format(base, name) if name else base
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, level):
    """Resolve a relative module name to an absolute one."""
    bits = package.rsplit('.', level - 1)
    if len(bits) < level:
        raise ImportError('attempted relative import beyond top-level package')
    base = bits[0]
    return '{}.{}'.format(base, name) if name else base
def _resolve_name ( name , package , level ) : bits = package . rsplit ( '.' , level - 1 ) if len ( bits ) < level : raise ImportError ( 'attempted relative import beyond top-level package' ) base = bits [ 0 ] return '{}.{}' . format ( base , name ) if name else base