summaryrefslogtreecommitdiff
path: root/cli/tools/jupyter
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/jupyter')
-rw-r--r--cli/tools/jupyter/server.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/cli/tools/jupyter/server.rs b/cli/tools/jupyter/server.rs
index c54dcd275..2489fcd04 100644
--- a/cli/tools/jupyter/server.rs
+++ b/cli/tools/jupyter/server.rs
@@ -391,15 +391,18 @@ impl JupyterServer {
let output =
get_jupyter_display_or_eval_value(&mut self.repl_session, &result)
.await?;
- msg
- .new_message("execute_result")
- .with_content(json!({
- "execution_count": self.execution_count,
- "data": output,
- "metadata": {},
- }))
- .send(&mut *self.iopub_socket.lock().await)
- .await?;
+ // Don't bother sending `execute_result` reply if the MIME bundle is empty
+ if !output.is_empty() {
+ msg
+ .new_message("execute_result")
+ .with_content(json!({
+ "execution_count": self.execution_count,
+ "data": output,
+ "metadata": {},
+ }))
+ .send(&mut *self.iopub_socket.lock().await)
+ .await?;
+ }
msg
.new_reply()
.with_content(json!({