Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Make 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
With using sys.argv[0] instead, it's possible to get a cProfile.
  • Loading branch information...
commit a5680be996defc5d7d1bc05d2d9418bdf80c92cd 1 parent 8bac8cb
@tomspur authored
Showing with 1 addition and 1 deletion.
  1. +1 −1 
2 
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.