diff options
author | Steven Knight <knight@baldmt.com> | 2010-04-09 16:57:36 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-04-09 16:57:36 (GMT) |
commit | 608d04e42b0de175c29b806517d4a32a594fa493 (patch) | |
tree | 4db3d9b215364c3fa3ab0898eb87221b945d260b /src/engine/SCons/Script | |
parent | 06d4efdf2ef4d7adfbaad8266dca5862c8f421af (diff) | |
download | SCons-608d04e42b0de175c29b806517d4a32a594fa493.zip SCons-608d04e42b0de175c29b806517d4a32a594fa493.tar.gz SCons-608d04e42b0de175c29b806517d4a32a594fa493.tar.bz2 |
Issue 2330: For forward compatibility, use "import profile" and have
the SCons.compat layer import cProfile as profile when it's available.
Diffstat (limited to 'src/engine/SCons/Script')
-rw-r--r-- | src/engine/SCons/Script/Main.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 9b8c94b..7909b0b 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -37,6 +37,8 @@ from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import SCons.compat + import os import os.path import sys @@ -1226,10 +1228,8 @@ def _exec_main(parser, values): import pdb pdb.Pdb().runcall(_main, parser) elif options.profile_file: - try: - from cProfile import Profile - except ImportError, e: - from profile import Profile + # compat layer imports "cProfile" for us if it's available. + 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 |