Skip to content

Commit

Permalink
Return a (correct) UTF-8 string to IPython...
Browse files Browse the repository at this point in the history
The current version was broken by Python 3. The fix is to have the
displayhook method of the BackendEmacs class to return a (correct)
UTF-8 string for further processing by IPython.
  • Loading branch information
EmmanuelCharpentier committed Nov 2, 2019
1 parent 5178ddb commit d83f09b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions emacs_sage_shell_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def displayhook(self, plain_text, rich_output):
return ({u'text/plain': msg}, {})

elif isinstance(rich_output, OutputLatex):
text = "BEGIN_TEXT:" + plain_text.text.get() + ":END_TEXTBEGIN_LATEX:" + \
rich_output.latex.get() + ":END_LATEX"
return ({u'text/plain': text}, {})
text = "BEGIN_TEXT:" + str(plain_text.text.get(), 'utf-8') + ":END_TEXTBEGIN_LATEX:" + \
str(rich_output.latex.get(), 'utf-8') + ":END_LATEX"
return ({'text/plain': text}, {})
else:
return super(BackendEmacs, self).displayhook(plain_text, rich_output)

Expand Down

0 comments on commit d83f09b

Please sign in to comment.