##// END OF EJS Templates
Remove deprecated encodestring infavor of encodebytes
Matthias Bussonnier -
Show More
@@ -5,7 +5,6 b''
5 # Distributed under the terms of the Modified BSD License.
5 # Distributed under the terms of the Modified BSD License.
6
6
7 from io import BytesIO, open
7 from io import BytesIO, open
8 from base64 import encodestring
9 import os
8 import os
10 import tempfile
9 import tempfile
11 import shutil
10 import shutil
@@ -15,7 +14,12 b' from IPython.utils.process import find_cmd, FindCmdError'
15 from traitlets.config import get_config
14 from traitlets.config import get_config
16 from traitlets.config.configurable import SingletonConfigurable
15 from traitlets.config.configurable import SingletonConfigurable
17 from traitlets import List, Bool, Unicode
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 class LaTeXTool(SingletonConfigurable):
25 class LaTeXTool(SingletonConfigurable):
@@ -86,7 +90,7 b' def latex_to_png(s, encode=False, backend=None, wrap=False):'
86 raise ValueError('No such backend {0}'.format(backend))
90 raise ValueError('No such backend {0}'.format(backend))
87 bin_data = f(s, wrap)
91 bin_data = f(s, wrap)
88 if encode and bin_data:
92 if encode and bin_data:
89 bin_data = encodestring(bin_data)
93 bin_data = encodebytes(bin_data)
90 return bin_data
94 return bin_data
91
95
92
96
General Comments 0
You need to be logged in to leave comments. Login now