diff --git a/nbconvert/preprocessors/execute.py b/nbconvert/preprocessors/execute.py index 45587d345..284c76945 100644 --- a/nbconvert/preprocessors/execute.py +++ b/nbconvert/preprocessors/execute.py @@ -480,7 +480,7 @@ def run_cell(self, cell, cell_index=0): continue elif msg_type.startswith('comm'): self.handle_comm_msg(outs, msg, cell_index) - self.widget_state[content['comm_id']] = content['data']['state'] + self.widget_state.setdefault(content['comm_id'], {}).update(content['data']['state']) continue display_id = None