mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Style refactoring in the `linkcheck` builder (#11501)
- Omit a variable that is unused aside from a ``return`` statement on the subsequent line. - Extract a variable for readability, and to reduce the complexity of a line.
This commit is contained in:
@@ -441,7 +441,8 @@ class HyperlinkAvailabilityCheckWorker(Thread):
|
||||
return 'broken', error_message, 0
|
||||
|
||||
# Success; clear rate limits for the origin
|
||||
self.rate_limits.pop(urlsplit(req_url).netloc, None)
|
||||
netloc = urlsplit(req_url).netloc
|
||||
self.rate_limits.pop(netloc, None)
|
||||
|
||||
if ((response_url.rstrip('/') == req_url.rstrip('/'))
|
||||
or _allowed_redirect(req_url, response_url,
|
||||
@@ -503,8 +504,7 @@ def _get_request_headers(
|
||||
|
||||
for u in candidates:
|
||||
if u in request_headers:
|
||||
headers = {**DEFAULT_REQUEST_HEADERS, **request_headers[u]}
|
||||
return headers
|
||||
return {**DEFAULT_REQUEST_HEADERS, **request_headers[u]}
|
||||
return {}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user