From 8768212e2f10ebffd0118d79eebfcc6f8debb6b2 2019-11-30 16:50:46 From: Matthias Bussonnier Date: 2019-11-30 16:50:46 Subject: [PATCH] Handle case where the shell does not have arbitrary mimerenderer handler. That can be the case in test-suites; for example bokeh Closes #11976 --- diff --git a/IPython/core/displaypub.py b/IPython/core/displaypub.py index d769692..f651a2a 100644 --- a/IPython/core/displaypub.py +++ b/IPython/core/displaypub.py @@ -105,7 +105,7 @@ class DisplayPublisher(Configurable): handlers = {} if self.shell is not None: - handlers = self.shell.mime_renderers + handlers = getattr(self.shell, 'mime_renderers', {}) for mime, handler in handlers.items(): if mime in data: