mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use `parsedate_tz
` in the linkcheck builder
This commit is contained in:
parent
b533ef1662
commit
ae0d97bb26
@ -490,9 +490,10 @@ class HyperlinkAvailabilityCheckWorker(Thread):
|
||||
try:
|
||||
# An HTTP-date: time of next attempt.
|
||||
parsed = parsedate_tz(retry_after)
|
||||
assert parsed is not None
|
||||
# the 10th element is the GMT offset in seconds
|
||||
next_check = time.mktime(parsed[:9]) - parsed[9]
|
||||
except (TypeError, ValueError):
|
||||
next_check = time.mktime(parsed[:9]) - (parsed[9] or 0)
|
||||
except (AssertionError, TypeError, ValueError):
|
||||
# TypeError: Invalid date format.
|
||||
# ValueError: Invalid date, e.g. Oct 52th.
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user