IPython current stable version is 2.3.1, and the code
in cinder-manage is only work for IPython < 0.11. The
patch make it work for IPython 2.3.1.
Change-Id: I1555744fbf80771455ebd9f9095e8f9ddc7d16e7
Closes-Bug: #
1413485
shell = 'ipython'
if shell == 'ipython':
try:
- import IPython
- # Explicitly pass an empty list as arguments, because
- # otherwise IPython would use sys.argv from this script.
- shell = IPython.Shell.IPShell(argv=[])
- shell.mainloop()
+ from IPython import embed
+ embed()
except ImportError:
- shell = 'python'
+ try:
+ # Ipython < 0.11
+ # Explicitly pass an empty list as arguments, because
+ # otherwise IPython would use sys.argv from this script.
+ import IPython
+
+ shell = IPython.Shell.IPShell(argv=[])
+ shell.mainloop()
+ except ImportError:
+ # no IPython module
+ shell = 'python'
if shell == 'python':
import code