def build_url(current_url, next_url): if is_url(next_url): return next_url else: return urljoin(current_url, next_url)