[Python-modules-commits] [ipykernel] 01/08: Import ipykernel_4.5.2.orig.tar.gz

Gordon Ball chronitis-guest at moszumanska.debian.org
Sun Dec 4 13:55:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

chronitis-guest pushed a commit to branch master
in repository ipykernel.

commit 2fde3650039ca6041bb8e34faaeb0ee0682ec5da
Author: Gordon Ball <gordon at chronitis.net>
Date:   Sun Dec 4 13:32:25 2016 +0100

    Import ipykernel_4.5.2.orig.tar.gz
---
 PKG-INFO               |  2 +-
 docs/changelog.rst     |  8 ++++++++
 ipykernel/_version.py  |  2 +-
 ipykernel/comm/comm.py | 15 ++++++++++-----
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/PKG-INFO b/PKG-INFO
index f6589cc..e003ecf 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: ipykernel
-Version: 4.5.1
+Version: 4.5.2
 Summary: IPython Kernel for Jupyter
 Home-page: http://ipython.org
 Author: IPython Development Team
diff --git a/docs/changelog.rst b/docs/changelog.rst
index a9acb1f..6af56b8 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -4,6 +4,14 @@ Changes in IPython kernel
 4.5
 ---
 
+4.5.2
+*****
+
+`4.5.2 on GitHub <https://github.com/ipython/ipykernel/milestones/4.5.2>`__
+
+- Fix bug when instantating Comms outside of the IPython kernel (introduced in 4.5.1).
+
+
 4.5.1
 *****
 
diff --git a/ipykernel/_version.py b/ipykernel/_version.py
index 22ed655..9816c2e 100644
--- a/ipykernel/_version.py
+++ b/ipykernel/_version.py
@@ -1,4 +1,4 @@
-version_info = (4, 5, 1)
+version_info = (4, 5, 2)
 __version__ = '.'.join(map(str, version_info))
 
 kernel_protocol_version_info = (5, 0)
diff --git a/ipykernel/comm/comm.py b/ipykernel/comm/comm.py
index 9ffc061..172c2b3 100644
--- a/ipykernel/comm/comm.py
+++ b/ipykernel/comm/comm.py
@@ -51,11 +51,12 @@ class Comm(LoggingConfigurable):
         if target_name:
             kwargs['target_name'] = target_name
         super(Comm, self).__init__(**kwargs)
-        if self.kernel is not None and self.primary:
-            # I am primary, open my peer.
-            self.open(data=data, metadata=metadata, buffers=buffers)
-        else:
-            self._closed = False
+        if self.kernel:
+            if self.primary:
+                # I am primary, open my peer.
+                self.open(data=data, metadata=metadata, buffers=buffers)
+            else:
+                self._closed = False
 
     def _publish_msg(self, msg_type, data=None, metadata=None, buffers=None, **keys):
         """Helper for sending a comm message on IOPub"""
@@ -103,6 +104,10 @@ class Comm(LoggingConfigurable):
             # only close once
             return
         self._closed = True
+        # nothing to send if we have no kernel
+        # can be None during interpreter cleanup
+        if not self.kernel:
+            return
         if data is None:
             data = self._close_data
         self._publish_msg('comm_close',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/ipykernel.git



More information about the Python-modules-commits mailing list