diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/sbin/bcfg2-info | 9 |
1 files changed, 7 insertions, 2 deletions
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() |