Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions sphinx-jsonschema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from docutils.parsers.rst import Directive, DirectiveError
from docutils.parsers.rst import directives
from docutils.utils import SystemMessagePropagation
from docutils.utils.error_reporting import SafeString
from .wide_format import WideFormat, NOESC


Expand Down Expand Up @@ -243,7 +242,7 @@ def get_json_data(self):
except Exception as error:
error = self.state_machine.reporter.error(
'"%s" directive encountered a the following error while parsing the data.\n %s'
% (self.name, SafeString("".join(format_exception_only(type(error), error)))),
% (self.name, str("".join(format_exception_only(type(error), error)))),
nodes.literal_block(schema, schema), line=self.lineno)
raise SystemMessagePropagation(error)

Expand All @@ -253,7 +252,7 @@ def get_json_data(self):
except KeyError:
error = self.state_machine.reporter.error(
'"%s" directive encountered a KeyError when trying to resolve the pointer'
' in schema: %s' % (self.name, SafeString(pointer)),
' in schema: %s' % (self.name, str(pointer)),
nodes.literal_block(schema, schema), line=self.lineno)
raise SystemMessagePropagation(error)

Expand Down