##// END OF EJS Templates
Prevent ipython.py launcher from being imported.
Stefan van der Walt -
Show More
@@ -1,18 +1,23 b''
1 1 #!/usr/bin/env python
2 2 # -*- coding: utf-8 -*-
3 3 """IPython -- An enhanced Interactive Python
4 4
5 5 The actual ipython script to be installed with 'python setup.py install' is
6 6 in './scripts' directory. This file is here (ipython source root directory)
7 7 to facilitate non-root 'zero-installation' (just copy the source tree
8 8 somewhere and run ipython.py) and development. """
9 9
10 if __name__ != "__main__":
11 raise RuntimeError('You are trying to import the ipython.py executable. '
12 'Did you mean to call "import IPython" (case-sensitive) instead?')
13
10 14 # Ensure that the imported IPython is the local one, not a system-wide one
11 15 import os, sys
12 16 this_dir = os.path.dirname(sys.argv[0])
13 17 sys.path.insert(0, this_dir)
14 18
15 19 # Now proceed with execution
16 20 execfile(os.path.join(
17 21 this_dir, 'IPython', 'scripts', 'ipython'
18 22 ))
23
General Comments 0
You need to be logged in to leave comments. Login now