From 99680b113a6cc0e97db0ec5485d1df1d1831ca59 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Mon, 2 Apr 2012 11:11:30 -0400 Subject: made bcfg2-info work with newer IPython --- src/sbin/bcfg2-info | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/sbin') diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index 3c1a0a3da..e09b7ed87 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -167,8 +167,13 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.Core): print("Dropping to python interpreter; press ^D to resume") try: import IPython - shell = IPython.Shell.IPShell(argv=[], user_ns=locals()) - shell.mainloop() + if hasattr(IPython, "Shell"): + shell = IPython.Shell.IPShell(argv=[], user_ns=locals()) + shell.mainloop() + elif hasattr(IPython, "embed"): + IPython.embed(user_ns=locals()) + else: + raise ImportError except ImportError: sh.interact() -- cgit v1.2.3-1-g7c22