From a2e0b2b262b3b29834d3a90d660e5963abec73a7 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(-) diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index b68434e11..1e7ec4d49 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -165,8 +165,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