MCPcopy Index your code
hub / github.com/clips/pattern / redirect

Method redirect

pattern/web/__init__.py:473–482  ·  view source on GitHub ↗

Yields the redirected URL, or None.

(self, timeout=10)

Source from the content-addressed store, hash-verified

471
472 @property
473 def redirect(self, timeout=10):
474 """ Yields the redirected URL, or None.
475 """
476 if self.__dict__["_redirect"] is None:
477 try:
478 r = self.open(timeout).geturl()
479 except URLError:
480 r = None
481 self.__dict__["_redirect"] = r != self.string and r or ""
482 return self.__dict__["_redirect"] or None
483
484 def __str__(self):
485 return bytestring(self.string)

Callers 1

test_redirectMethod · 0.80

Calls 1

openMethod · 0.95

Tested by 1

test_redirectMethod · 0.64