mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #1815: linkcheck does not raise an exception if warniserror set to true and link is broken
This commit is contained in:
parent
c305f30ae4
commit
2bcf92dfb0
1
CHANGES
1
CHANGES
@ -25,6 +25,7 @@ Bugs fixed
|
||||
* #2206: Fix Sphinx latex doc build failed due to a footnotes
|
||||
* #2201: Fix wrong table caption for tables with over 30 rows
|
||||
* #2213: Set <blockquote> in the classic theme to fit with <p>
|
||||
* #1815: Fix linkcheck does not raise an exception if warniserror set to true and link is broken
|
||||
|
||||
Release 1.3.3 (released Dec 2, 2015)
|
||||
====================================
|
||||
|
@ -243,11 +243,12 @@ class CheckExternalLinksBuilder(Builder):
|
||||
elif status == 'working':
|
||||
self.info(darkgreen('ok ') + uri + info)
|
||||
elif status == 'broken':
|
||||
self.info(red('broken ') + uri + red(' - ' + info))
|
||||
self.write_entry('broken', docname, lineno, uri + ': ' + info)
|
||||
if self.app.quiet:
|
||||
if self.app.quiet or self.app.warningiserror:
|
||||
self.warn('broken link: %s' % uri,
|
||||
'%s:%s' % (self.env.doc2path(docname), lineno))
|
||||
else:
|
||||
self.info(red('broken ') + uri + red(' - ' + info))
|
||||
elif status == 'redirected':
|
||||
text, color = {
|
||||
301: ('permanently', darkred),
|
||||
|
@ -262,9 +262,10 @@ Results of doctest builder run on %s
|
||||
self.outfile.write(text)
|
||||
|
||||
def _warn_out(self, text):
|
||||
self.info(text, nonl=True)
|
||||
if self.app.quiet:
|
||||
if self.app.quiet or self.app.warningiserror:
|
||||
self.warn(text)
|
||||
else:
|
||||
self.info(text, nonl=True)
|
||||
if isinstance(text, binary_type):
|
||||
text = force_decode(text, None)
|
||||
self.outfile.write(text)
|
||||
|
Loading…
Reference in New Issue
Block a user