Fix flake8 violations

This commit is contained in:
Takeshi KOMIYA 2018-07-16 21:03:32 +09:00
parent 052f24face
commit 2bdbe3aaf4
5 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ directory = sphinx/locale/
[flake8]
max-line-length = 95
ignore = E116,E241,E251,E741,I101
ignore = E116,E241,E251,E741,W504,I101
exclude = .git,.tox,.venv,tests/*,build/*,doc/_build/*,sphinx/search/*,doc/ext/example*.py
application-import-names = sphinx
import-order-style = smarkets

View File

@ -158,7 +158,7 @@ class CheckExternalLinksBuilder(Builder):
# the server and the network
response = requests.head(req_url, config=self.app.config, **kwargs)
response.raise_for_status()
except HTTPError as err:
except HTTPError:
# retry with GET request if that fails, some servers
# don't like HEAD requests.
response = requests.get(req_url, stream=True, config=self.app.config,

View File

@ -29,7 +29,7 @@ if False:
from sphinx.application import Sphinx # NOQA
glob_re = re.compile('.*[*?\[].*')
glob_re = re.compile(r'.*[*?\[].*')
def int_or_nothing(argument):

View File

@ -263,7 +263,7 @@ def find_autosummary_in_docstring(name, module=None, filename=None):
pass
except ImportError as e:
print("Failed to import '%s': %s" % (name, e))
except SystemExit as e:
except SystemExit:
print("Failed to import '%s'; the module executes module level "
"statement and it might call sys.exit()." % name)
return []

View File

@ -235,7 +235,7 @@ class ExtBabel(Babel):
def get_mainlanguage_options(self):
# type: () -> unicode
"""Return options for polyglossia's ``\setmainlanguage``."""
"""Return options for polyglossia's ``\\setmainlanguage``."""
language = super(ExtBabel, self).get_language()
if self.use_polyglossia is False:
return None