mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #2313 from alex/idiomatic
Make some code in linkcheck more idiomatic
This commit is contained in:
commit
fed5a34568
@ -204,10 +204,9 @@ class CheckExternalLinksBuilder(Builder):
|
|||||||
|
|
||||||
def check():
|
def check():
|
||||||
# check for various conditions without bothering the network
|
# check for various conditions without bothering the network
|
||||||
if len(uri) == 0 or uri[0] == '#' or \
|
if len(uri) == 0 or uri.startswith(('#', 'mailto:', 'ftp:')):
|
||||||
uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:':
|
|
||||||
return 'unchecked', '', 0
|
return 'unchecked', '', 0
|
||||||
elif not (uri[0:5] == 'http:' or uri[0:6] == 'https:'):
|
elif not uri.startswith(('http:', 'https:')):
|
||||||
return 'local', '', 0
|
return 'local', '', 0
|
||||||
elif uri in self.good:
|
elif uri in self.good:
|
||||||
return 'working', 'old', 0
|
return 'working', 'old', 0
|
||||||
|
Loading…
Reference in New Issue
Block a user