Issue 1913: use cProfile instead of profile if available
authorGregNoel <GregNoel@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 9 Sep 2008 23:44:59 +0000 (23:44 +0000)
committerGregNoel <GregNoel@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 9 Sep 2008 23:44:59 +0000 (23:44 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@3380 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Script/Main.py

index 96b18a48f5ee2e912c5e70317f3c62ae6f5d4378..4a4dd84f97b57b4063559416da0769d8e4754850 100644 (file)
@@ -1186,7 +1186,10 @@ def _exec_main(parser, values):
         import pdb
         pdb.Pdb().runcall(_main, parser)
     elif options.profile_file:
-        from profile import Profile
+        try:
+            from cProfile import Profile
+        except ImportError, e:
+            from profile import Profile
 
         # Some versions of Python 2.4 shipped a profiler that had the
         # wrong 'c_exception' entry in its dispatch table.  Make sure