diff options
Diffstat (limited to 'doc/sphinx/kernel_include.py')
| -rwxr-xr-x | doc/sphinx/kernel_include.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/sphinx/kernel_include.py b/doc/sphinx/kernel_include.py index f523aa68a36..6522de9dd69 100755 --- a/doc/sphinx/kernel_include.py +++ b/doc/sphinx/kernel_include.py @@ -34,11 +34,13 @@ u""" import os.path from docutils import io, nodes, statemachine -from docutils.utils.error_reporting import SafeString, ErrorString from docutils.parsers.rst import directives from docutils.parsers.rst.directives.body import CodeBlock, NumberLines from docutils.parsers.rst.directives.misc import Include +def ErrorString(exc): # Shamelessly stolen from docutils + return f'{exc.__class__.__name}: {exc}' + __version__ = '1.0' # ============================================================================== @@ -109,7 +111,7 @@ class KernelInclude(Include): raise self.severe('Problems with "%s" directive path:\n' 'Cannot encode input file path "%s" ' '(wrong locale?).' % - (self.name, SafeString(path))) + (self.name, path)) except IOError as error: raise self.severe('Problems with "%s" directive path:\n%s.' % (self.name, ErrorString(error))) |
