From 2f9b8f9a76a7b5835b18e168d6d3192d75069699 2023-07-06 19:01:40 From: David Toneian Date: 2023-07-06 19:01:40 Subject: [PATCH] Change "Non Expected" to "Unexpected" in exception messages. --- diff --git a/IPython/sphinxext/ipython_directive.py b/IPython/sphinxext/ipython_directive.py index c428e79..10257a6 100644 --- a/IPython/sphinxext/ipython_directive.py +++ b/IPython/sphinxext/ipython_directive.py @@ -581,7 +581,9 @@ class EmbeddedSphinxShell(object): s += "<<<" + ("-" * 73) logger.warning(s) if self.warning_is_error: - raise RuntimeError('Non Expected exception in `{}` line {}'.format(filename, lineno)) + raise RuntimeError( + "Unexpected exception in `{}` line {}".format(filename, lineno) + ) # output any warning raised during execution to stdout # unless :okwarning: has been specified. @@ -597,7 +599,9 @@ class EmbeddedSphinxShell(object): s += "<<<" + ("-" * 73) logger.warning(s) if self.warning_is_error: - raise RuntimeError('Non Expected warning in `{}` line {}'.format(filename, lineno)) + raise RuntimeError( + "Unexpected warning in `{}` line {}".format(filename, lineno) + ) self.clear_cout() return (ret, input_lines, processed_output,