Permalink
Browse files

Prevent ipython.py launcher from being imported.

  • Loading branch information...
1 parent 32f3d05 commit afb86869978804ce17ba66dbb08a29f8f5f3ee0d @stefanv committed Aug 15, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 ipython.py
View
@@ -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'
))
+

0 comments on commit afb8686

Please sign in to comment.