Permalink
Browse files

Make ipython.py cProfile-able

When using __file__ on startup and cProfile in the same time, __file__
is defined as the __file__ of cProfile and not the local ipython.py.
With using sys.argv[0] instead, it's possible to get a cProfile.
  • Loading branch information...
tomspur committed Nov 5, 2010
1 parent 8bac8cb commit a5680be996defc5d7d1bc05d2d9418bdf80c92cd
Showing with 1 addition and 1 deletion.
  1. +1 −1 ipython.py
View
@@ -9,7 +9,7 @@
# Ensure that the imported IPython is the local one, not a system-wide one
import os, sys
-this_dir = os.path.dirname(os.path.abspath(__file__))
+this_dir = os.path.dirname(sys.argv[0])
sys.path.insert(0, this_dir)
# Now proceed with execution

0 comments on commit a5680be

Please sign in to comment.