From 4fe63dd38f3bd21668ff0f4a6b41867c69651bcc Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 20 Jan 2015 15:46:42 -0800 Subject: [PATCH] don't set language_info to an empty dict delete it from metadata if language_info is undefined --- IPython/html/static/notebook/js/notebook.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index 805924523..895b10add 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -256,7 +256,11 @@ define([ this.events.on('kernel_ready.Kernel', function(event, data) { var kinfo = data.kernel.info_reply; - var langinfo = kinfo.language_info || {}; + if (!kinfo.language_info) { + delete that.metadata.language_info; + return; + } + var langinfo = kinfo.language_info; that.metadata.language_info = langinfo; // Mode 'null' should be plain, unhighlighted text. var cm_mode = langinfo.codemirror_mode || langinfo.name || 'null';