MCPcopy Index your code
hub / github.com/python/cpython / redirect

Method redirect

Lib/test/test_urllib2.py:1290–1292  ·  view source on GitHub ↗
(h, req, url=to_url)

Source from the content-addressed store, hash-verified

1288 req.timeout = socket._GLOBAL_DEFAULT_TIMEOUT
1289
1290 def redirect(h, req, url=to_url):
1291 h.http_error_302(req, MockFile(), 302, "Blah",
1292 MockHeaders({"location": url}))
1293 # Note that the *original* request shares the same record of
1294 # redirections with the sub-requests caused by the redirections.
1295

Callers

nothing calls this directly

Calls 3

MockHeadersClass · 0.85
http_error_302Method · 0.80
MockFileClass · 0.70

Tested by

no test coverage detected