##// END OF EJS Templates
darker
richard -
Show More
@@ -563,8 +563,10 b' class EmbeddedSphinxShell(object):'
563 563
564 564 # output any exceptions raised during execution to stdout
565 565 # unless :okexcept: has been specified.
566 if not is_okexcept and (("Traceback" in processed_output) or ("SyntaxError" in processed_output)):
567 s = '\n>>>' + ('-' * 73) + '\n'
566 if not is_okexcept and (
567 ("Traceback" in processed_output) or ("SyntaxError" in processed_output)
568 ):
569 s = "\n>>>" + ("-" * 73) + "\n"
568 570 s += "Exception in %s at block ending on line %s\n" % (filename, lineno)
569 571 s += "Specify :okexcept: as an option in the ipython:: block to suppress this message\n"
570 572 s += processed_output + "\n"
@@ -577,13 +579,14 b' class EmbeddedSphinxShell(object):'
577 579 # unless :okwarning: has been specified.
578 580 if not is_okwarning:
579 581 for w in ws:
580 s = '\n>>>' + ('-' * 73) + '\n'
582 s = "\n>>>" + ("-" * 73) + "\n"
581 583 s += "Warning in %s at block ending on line %s\n" % (filename, lineno)
582 584 s += "Specify :okwarning: as an option in the ipython:: block to suppress this message\n"
583 s += ('-' * 76) + '\n'
584 s += warnings.formatwarning(w.message, w.category,
585 w.filename, w.lineno, w.line)
586 s += '<<<' + ('-' * 73)
585 s += ("-" * 76) + "\n"
586 s += warnings.formatwarning(
587 w.message, w.category, w.filename, w.lineno, w.line
588 )
589 s += "<<<" + ("-" * 73)
587 590 logger.warning(s)
588 591 if self.warning_is_error:
589 592 raise RuntimeError('Non Expected warning in `{}` line {}'.format(filename, lineno))
General Comments 0
You need to be logged in to leave comments. Login now