diff options
author | Georg Brandl <georg@python.org> | 2016-02-13 18:12:02 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2016-02-13 18:12:02 +0100 |
commit | fed5a345688ff1c2bc0887d6202b46224af25f0b (patch) | |
tree | 9f034343343d9d1baa8567bb113b6ea1a4e0c4b3 | |
parent | ee3306796beff91a1d96d8c393a8619e0f2cc164 (diff) | |
parent | 3f2612ee787ebaaecacaa8b4b2a1f32afa33a332 (diff) | |
download | sphinx-git-fed5a345688ff1c2bc0887d6202b46224af25f0b.tar.gz |
Merge pull request #2313 from alex/idiomatic
Make some code in linkcheck more idiomatic
-rw-r--r-- | sphinx/builders/linkcheck.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py index 8a8d22184..0533f1c50 100644 --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -204,10 +204,9 @@ class CheckExternalLinksBuilder(Builder): def check(): # check for various conditions without bothering the network - if len(uri) == 0 or uri[0] == '#' or \ - uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:': + if len(uri) == 0 or uri.startswith(('#', 'mailto:', 'ftp:')): return 'unchecked', '', 0 - elif not (uri[0:5] == 'http:' or uri[0:6] == 'https:'): + elif not uri.startswith(('http:', 'https:')): return 'local', '', 0 elif uri in self.good: return 'working', 'old', 0 |