Skip to content

Commit 92441ba

Browse files
committed
use xeus's routines in internal_request_impl
1 parent 5398530 commit 92441ba

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/xinterpreter.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,14 @@ namespace xpyt
318318
{
319319
py::gil_scoped_acquire acquire;
320320
std::string code = content.value("code", "");
321-
nl::json reply;
322321

323322
// Reset traceback
324323
m_ipython_shell.attr("last_error") = py::none();
325324

326325
try
327326
{
328327
exec(py::str(code));
329-
reply["status"] = "ok";
328+
return xeus::create_successful_reply();
330329
}
331330
catch (py::error_already_set& e)
332331
{
@@ -341,13 +340,8 @@ namespace xpyt
341340
error.m_traceback.resize(1);
342341
error.m_traceback[0] = code;
343342

344-
reply["status"] = "error";
345-
reply["ename"] = error.m_ename;
346-
reply["evalue"] = error.m_evalue;
347-
reply["traceback"] = error.m_traceback;
343+
return xeus::create_error_reply(error.m_ename, error.m_evalue, error.m_traceback);
348344
}
349-
350-
return reply;
351345
}
352346

353347
void interpreter::set_request_context(xeus::xrequest_context context)

0 commit comments

Comments
 (0)