Show More
@@ -5,7 +5,6 b'' | |||
|
5 | 5 | # Distributed under the terms of the Modified BSD License. |
|
6 | 6 | |
|
7 | 7 | from io import BytesIO, open |
|
8 | from base64 import encodestring | |
|
9 | 8 | import os |
|
10 | 9 | import tempfile |
|
11 | 10 | import shutil |
@@ -15,7 +14,12 b' from IPython.utils.process import find_cmd, FindCmdError' | |||
|
15 | 14 | from traitlets.config import get_config |
|
16 | 15 | from traitlets.config.configurable import SingletonConfigurable |
|
17 | 16 | from traitlets import List, Bool, Unicode |
|
18 | from IPython.utils.py3compat import cast_unicode, cast_unicode_py2 as u | |
|
17 | from IPython.utils.py3compat import cast_unicode, cast_unicode_py2 as u, PY3 | |
|
18 | ||
|
19 | if PY3: | |
|
20 | from base64 import encodebytes | |
|
21 | else : | |
|
22 | from base64 import encodestring as encodebytes | |
|
19 | 23 | |
|
20 | 24 | |
|
21 | 25 | class LaTeXTool(SingletonConfigurable): |
@@ -86,7 +90,7 b' def latex_to_png(s, encode=False, backend=None, wrap=False):' | |||
|
86 | 90 | raise ValueError('No such backend {0}'.format(backend)) |
|
87 | 91 | bin_data = f(s, wrap) |
|
88 | 92 | if encode and bin_data: |
|
89 |
bin_data = encodes |
|
|
93 | bin_data = encodebytes(bin_data) | |
|
90 | 94 | return bin_data |
|
91 | 95 | |
|
92 | 96 |
General Comments 0
You need to be logged in to leave comments.
Login now