Prevent ipython.py launcher from being imported. #702

Merged
merged 1 commit into from Aug 15, 2011
View
5 ipython.py
@@ -7,6 +7,10 @@
to facilitate non-root 'zero-installation' (just copy the source tree
somewhere and run ipython.py) and development. """
+if __name__ != "__main__":
+ raise RuntimeError('You are trying to import the ipython.py executable. '
+ 'Did you mean to call "import IPython" (case-sensitive) instead?')
+
# Ensure that the imported IPython is the local one, not a system-wide one
import os, sys
this_dir = os.path.dirname(sys.argv[0])
@@ -16,3 +20,4 @@
execfile(os.path.join(
this_dir, 'IPython', 'scripts', 'ipython'
))
+