diff --git a/IPython/html/static/notebook/js/kernelselector.js b/IPython/html/static/notebook/js/kernelselector.js index c9623e7..0c45116 100644 --- a/IPython/html/static/notebook/js/kernelselector.js +++ b/IPython/html/static/notebook/js/kernelselector.js @@ -218,7 +218,8 @@ define([ return; } } - if (this.notebook._session_starting) { + if (this.notebook._session_starting && + this.notebook.session.kernel.name !== ks.name) { console.error("Cannot change kernel while waiting for pending session start."); return; } diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index a8675df..9569a6f 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -232,7 +232,7 @@ define(function (require) { language: data.spec.language, }; // start session if the current session isn't already correct - if (!(this.session && this.session.kernel && this.session.kernel.name === data.name)) { + if (!(that.session && that.session.kernel && that.session.kernel.name === data.name)) { that.start_session(data.name); } });