summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-04-02 11:11:30 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-04 11:06:12 -0400
commit99680b113a6cc0e97db0ec5485d1df1d1831ca59 (patch)
tree91679b88b4d45dc4c02aa2971259fa96215ef6fc /src
parenta24165b9b7dd05a104cc10176e54fa9b5bb91812 (diff)
downloadbcfg2-99680b113a6cc0e97db0ec5485d1df1d1831ca59.tar.gz
bcfg2-99680b113a6cc0e97db0ec5485d1df1d1831ca59.tar.bz2
bcfg2-99680b113a6cc0e97db0ec5485d1df1d1831ca59.zip
made bcfg2-info work with newer IPython
Diffstat (limited to 'src')
-rwxr-xr-xsrc/sbin/bcfg2-info9
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()