From 0ef85028d7a4f596c186ddbbfd3092986d779016 Mon Sep 17 00:00:00 2001 From: Min RK Date: Sat, 31 Jan 2015 14:27:15 -0800 Subject: [PATCH] don't prevent spec_changed from firing on load fixes check for the case where kernelspec info is coming from the kernel, rather than notebook metadata. This case was getting skipped by a bad check on `_session_starting`. --- IPython/html/static/notebook/js/kernelselector.js | 3 ++- IPython/html/static/notebook/js/notebook.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/IPython/html/static/notebook/js/kernelselector.js b/IPython/html/static/notebook/js/kernelselector.js index c9623e7d2..0c451161c 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 a8675dfb5..9569a6faf 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); } });