diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-04-16 22:01:00 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-04-16 22:01:00 (GMT) |
commit | e4b439f4265613556de0124593ac86898d6f52c7 (patch) | |
tree | 5fb5a4bdb919e42f85be12114a204659bfb3fef4 /src/script | |
parent | ded0f52f11f5c97959ee8070a2687ecb14e69e3f (diff) | |
download | SCons-e4b439f4265613556de0124593ac86898d6f52c7.zip SCons-e4b439f4265613556de0124593ac86898d6f52c7.tar.gz SCons-e4b439f4265613556de0124593ac86898d6f52c7.tar.bz2 |
http://scons.tigris.org/issues/show_bug.cgi?id=2345
Quiet the rest of the 'callable' warnings and fix the rest of the 'cmp
argument' warnings.
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/scons-time.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/script/scons-time.py b/src/script/scons-time.py index fa04d37..d85dc8e 100644 --- a/src/script/scons-time.py +++ b/src/script/scons-time.py @@ -38,7 +38,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import getopt import glob import os -import os.path import re import shutil import sys @@ -82,6 +81,20 @@ except NameError: result.reverse() return result +if os.environ.get('SCONS_HORRIBLE_REGRESSION_TEST_HACK') is not None: + # We can't apply the 'callable' fixer until the floor is 2.6, but the + # '-3' option to Python 2.6 and 2.7 generates almost ten thousand + # warnings. This hack allows us to run regression tests with the '-3' + # option by replacing the callable() built-in function with a hack + # that performs the same function but doesn't generate the warning. + # Note that this hack is ONLY intended to be used for regression + # testing, and should NEVER be used for real runs. + from types import ClassType + def callable(obj): + if hasattr(obj, '__call__'): return True + if isinstance(obj, (ClassType, type)): return True + return False + def make_temp_file(**kw): try: result = tempfile.mktemp(**kw) |