Skip to content

Commit af1779a

Browse files
committed
use xeus's routines in inspect_request_impl
1 parent 8afa212 commit af1779a

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/xinterpreter.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ namespace xpyt
224224
int detail_level)
225225
{
226226
py::gil_scoped_acquire acquire;
227-
nl::json kernel_res;
228227
nl::json data = nl::json::object();
229228
bool found = false;
230229

@@ -244,11 +243,7 @@ namespace xpyt
244243
// pass
245244
}
246245

247-
kernel_res["data"] = data;
248-
kernel_res["metadata"] = nl::json::object();
249-
kernel_res["found"] = found;
250-
kernel_res["status"] = "ok";
251-
return kernel_res;
246+
return xeus::create_inspect_reply(found, data, nl::json::object());
252247
}
253248

254249
nl::json interpreter::is_complete_request_impl(const std::string& code)

src/xinterpreter_raw.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,7 @@ namespace xpyt
268268
pub_data["text/plain"] = docstring;
269269
}
270270

271-
kernel_res["data"] = pub_data;
272-
kernel_res["metadata"] = nl::json::object();
273-
kernel_res["found"] = found;
274-
kernel_res["status"] = "ok";
275-
return kernel_res;
271+
return xeus::create_inspect_reply(found, pub_data, nl::json::object());
276272
}
277273

278274
nl::json raw_interpreter::is_complete_request_impl(const std::string&)

0 commit comments

Comments
 (0)