def set_url(self, url): if is_lazy_url(url, ignore=True): self.url = url elif is_str(url, ignore=True): self.url = LazyUrl(url) else: raise TypeError('Cannot set the url with %r. Use a LazyUrl or a str' % type(url))
def set_url(self, url): if is_lazy_url(url, ignore=True): self.url = url else: self.url = LazyUrl(url)