Skip to content

Commit

Permalink
Fix compatibility with IPython 5.x (fix #189)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmalloc committed Jun 9, 2016
1 parent 564ab64 commit 64b1261
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pudb/shell.py
Expand Up @@ -12,6 +12,12 @@
else:
HAVE_IPYTHON = True


if HAVE_IPYTHON:
from IPython import version_info as IPYTHON_VERSION
else:
IPYTHON_VERSION = None

try:
import bpython # noqa
# Access a property to verify module exists in case
Expand Down Expand Up @@ -154,7 +160,13 @@ def run_ipython_shell_v11(locals, globals, first_time):
old_globals = shell.user_global_ns
# Update shell with current namespace
_update_ns(shell, locals, globals)
shell.mainloop(banner)

args = []
if IPYTHON_VERSION < (5, 0, 0):
args.append(banner)
else:
print(banner)
shell.mainloop(*args)
# Restore originating namespace
_update_ns(shell, old_locals, old_globals)

Expand Down

0 comments on commit 64b1261

Please sign in to comment.