Merge branch 'stable'

This commit is contained in:
Takeshi KOMIYA 2017-10-23 23:04:32 +09:00
commit e3baf213f5
10 changed files with 20 additions and 20 deletions

View File

@ -28,7 +28,7 @@ license_file = LICENSE
[flake8]
max-line-length = 95
ignore = E116,E241,E251
ignore = E116,E241,E251,E741
exclude = .git,.tox,.venv,tests/*,build/*,doc/_build/*,sphinx/search/*,sphinx/pycode/pgen2/*,doc/ext/example*.py
[mypy]

View File

@ -4862,7 +4862,7 @@ class DefinitionParser(object):
pos = self.pos
try:
concept = self._parse_nested_name()
except:
except Exception:
self.pos = pos
return None
self.skip_ws()

View File

@ -171,7 +171,7 @@ class _TranslationProxy(UserString, object):
# type: () -> str
try:
return 'i' + repr(text_type(self.data))
except:
except Exception:
return '<%s broken>' % self.__class__.__name__

View File

@ -132,7 +132,7 @@ class SphinxTestApp(application.Sphinx):
application.Sphinx.__init__(self, srcdir, confdir, outdir, doctreedir,
buildername, confoverrides, status, warning,
freshenv, warningiserror, tags)
except:
except Exception:
self.cleanup()
raise

View File

@ -157,7 +157,7 @@ def is_archived_theme(filename):
try:
with ZipFile(filename) as f: # type: ignore
return THEMECONF in f.namelist()
except:
except Exception:
return False

View File

@ -64,7 +64,7 @@ def get_image_size(filename):
pass
return size
except:
except Exception:
return None

View File

@ -139,7 +139,7 @@ def educateQuotes(text, language='en'):
smart = smartquotes.smartchars(language)
try:
apostrophe = smart.apostrophe
except:
except Exception:
apostrophe = u''
# oldtext = text

View File

@ -1035,6 +1035,6 @@ def test_latex_image_in_parsed_literal(app, status, warning):
app.builder.build_all()
result = (app.outdir / 'Python.tex').text(encoding='utf8')
assert ('{\\sphinxunactivateextrasandspace \\raisebox{-0.5\height}'
assert ('{\\sphinxunactivateextrasandspace \\raisebox{-0.5\\height}'
'{\\scalebox{2.000000}{\\sphinxincludegraphics[height=1cm]{{pic}.png}}}'
'}AFTER') in result

View File

@ -197,28 +197,28 @@ def test_text_inconsistency_warnings(app, warning):
expected_warning_expr = (
warning_fmt % {
u'reftype': u'footnote references',
u'original': u"\[u?'\[#\]_'\]",
u'translated': u"\[\]"
u'original': u"\\[u?'\\[#\\]_'\\]",
u'translated': u"\\[\\]"
} +
warning_fmt % {
u'reftype': u'footnote references',
u'original': u"\[u?'\[100\]_'\]",
u'translated': u"\[\]"
u'original': u"\\[u?'\\[100\\]_'\\]",
u'translated': u"\\[\\]"
} +
warning_fmt % {
u'reftype': u'references',
u'original': u"\[u?'reference_'\]",
u'translated': u"\[u?'reference_', u?'reference_'\]"
u'original': u"\\[u?'reference_'\\]",
u'translated': u"\\[u?'reference_', u?'reference_'\\]"
} +
warning_fmt % {
u'reftype': u'references',
u'original': u"\[\]",
u'translated': u"\[u?'`I18N WITH REFS INCONSISTENCY`_'\]"
u'original': u"\\[\\]",
u'translated': u"\\[u?'`I18N WITH REFS INCONSISTENCY`_'\\]"
})
assert_re_search(expected_warning_expr, warnings)
expected_citation_warning_expr = (
u'.*/refs_inconsistency.txt:\\d+: WARNING: Citation \[ref2\] is not referenced.\n' +
u'.*/refs_inconsistency.txt:\\d+: WARNING: Citation \\[ref2\\] is not referenced.\n' +
u'.*/refs_inconsistency.txt:\\d+: WARNING: citation not found: ref3')
assert_re_search(expected_citation_warning_expr, warnings)
@ -300,8 +300,8 @@ def test_text_glossary_term_inconsistencies(app, warning):
expected_warning_expr = (
u'.*/glossary_terms_inconsistency.txt:\\d+: '
u'WARNING: inconsistent term references in translated message.'
u" original: \[u?':term:`Some term`', u?':term:`Some other term`'\],"
u" translated: \[u?':term:`SOME NEW TERM`'\]\n")
u" original: \\[u?':term:`Some term`', u?':term:`Some other term`'\\],"
u" translated: \\[u?':term:`SOME NEW TERM`'\\]\n")
assert_re_search(expected_warning_expr, warnings)

View File

@ -81,7 +81,7 @@ def processing(message):
yield
except Skip as exc:
print('skip: %s' % exc)
except:
except Exception:
print('error')
raise
else: