mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'stable'
This commit is contained in:
commit
e3baf213f5
@ -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]
|
||||
|
@ -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()
|
||||
|
@ -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__
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -64,7 +64,7 @@ def get_image_size(filename):
|
||||
pass
|
||||
|
||||
return size
|
||||
except:
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
||||
|
@ -139,7 +139,7 @@ def educateQuotes(text, language='en'):
|
||||
smart = smartquotes.smartchars(language)
|
||||
try:
|
||||
apostrophe = smart.apostrophe
|
||||
except:
|
||||
except Exception:
|
||||
apostrophe = u'’'
|
||||
|
||||
# oldtext = text
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
@ -81,7 +81,7 @@ def processing(message):
|
||||
yield
|
||||
except Skip as exc:
|
||||
print('skip: %s' % exc)
|
||||
except:
|
||||
except Exception:
|
||||
print('error')
|
||||
raise
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user