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:
|
try:
|
||||||
# An HTTP-date: time of next attempt.
|
# An HTTP-date: time of next attempt.
|
||||||
parsed = parsedate_tz(retry_after)
|
parsed = parsedate_tz(retry_after)
|
||||||
|
assert parsed is not None
|
||||||
# the 10th element is the GMT offset in seconds
|
# the 10th element is the GMT offset in seconds
|
||||||
next_check = time.mktime(parsed[:9]) - parsed[9]
|
next_check = time.mktime(parsed[:9]) - (parsed[9] or 0)
|
||||||
except (TypeError, ValueError):
|
except (AssertionError, TypeError, ValueError):
|
||||||
# TypeError: Invalid date format.
|
# TypeError: Invalid date format.
|
||||||
# ValueError: Invalid date, e.g. Oct 52th.
|
# ValueError: Invalid date, e.g. Oct 52th.
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user