Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ipykernel/zmqshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from IPython.core.magics import MacroToEdit, CodeMagics
from IPython.core.magic import magics_class, line_magic, Magics
from IPython.core import payloadpage
from IPython.core.usage import default_gui_banner
from IPython.core.usage import default_banner
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer that we could do the removal of default_gui_banner in the next minor IPython release instead of the next major one (given that's such a small change).

So I propose to enclose this in a try/except block, like this:

try:
    from IPython.core.usage import default_gui_banner as default_banner
except ImportError:
    from IPython.core.usage import default_banner

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The try/except is not necessary, because default_banner was already defined. The issue is that the IPython release that removes default_gui_banner will break compatibility with any ipykernel releases before this PR is merged, including at least ipykernel 4.2.2, the current release. So I don't think we should backport that change to a 4.x release.

Why would it be a problem to have a couple of unused variables sitting in IPython, anyway?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I was thinking that a new release of ipykernel would be hold until IPython 5.0 is ready.

But you're right, default_banner is present in previous IPython releases, so there's no problem with this change :-)

from IPython.display import display, Javascript
from ipykernel import (
get_connection_file, get_connection_info, connect_qtconsole
Expand Down Expand Up @@ -350,7 +350,7 @@ class ZMQInteractiveShell(InteractiveShell):
parent_header = Any()

def _banner1_default(self):
return default_gui_banner
return default_banner

# Override the traitlet in the parent class, because there's no point using
# readline for the kernel. Can be removed when the readline code is moved
Expand Down