8000 More python2 suport · Calysto/matlab_kernel@4c826a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c826a5

Browse files
committed
More python2 suport
1 parent 7772c61 commit 4c826a5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

matlab_kernel/kernel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ def _execute_async(self, code):
248248
def _execute_sync(self, code):
249249
out = StringIO()
250250
err = StringIO()
251+
if not isinstance(code, str):
252+
code = code.encode('utf8')
251253
try:
252254
self._matlab.eval(code, nargout=0, stdout=out, stderr=err)
253255
except (SyntaxError, MatlabExecutionError) as exc:

0 commit comments

Comments
 (0)
0