summaryrefslogtreecommitdiff
path: root/test/option
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-04-19 02:28:06 +0000
committerSteven Knight <knight@baldmt.com>2010-04-19 02:28:06 +0000
commitc0788ce3eac2ab64353eabbdc845cfa214d0d5c3 (patch)
tree17b7ed783aafcd8fdb28147b1bbe621bf4d3f9a4 /test/option
parent4d1aa9d6186853ee0c88b0f1cb22e6015d459e08 (diff)
downloadscons-c0788ce3eac2ab64353eabbdc845cfa214d0d5c3.tar.gz
Remove use of the "new" module from --debug=memoizer support.
Diffstat (limited to 'test/option')
-rw-r--r--test/option/debug-memoizer.py50
1 files changed, 6 insertions, 44 deletions
diff --git a/test/option/debug-memoizer.py b/test/option/debug-memoizer.py
index f8e4cc3d..222ba677 100644
--- a/test/option/debug-memoizer.py
+++ b/test/option/debug-memoizer.py
@@ -29,33 +29,11 @@ Test calling the --debug=memoizer option.
"""
import os
-import new
+
import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
-# Find out if we support metaclasses (Python 2.2 and later).
-
-class M:
- def __init__(cls, name, bases, cls_dict):
- cls.use_metaclass = 1
- def fake_method(self):
- pass
- new.instancemethod(fake_method, None, cls)
-
-try:
- class A:
- __metaclass__ = M
-
- use_metaclass = A.use_metaclass
-except AttributeError:
- use_metaclass = None
- reason = 'no metaclasses'
-except TypeError:
- use_metaclass = None
- reason = 'new.instancemethod\\(\\) bug'
-
-
test.write('SConstruct', """
def cat(target, source, env):
@@ -79,27 +57,9 @@ expect = [
]
-if use_metaclass:
-
- def run_and_check(test, args, desc):
- test.run(arguments = args)
- test.must_contain_any_line(test.stdout(), expect)
-
-else:
-
- expect_no_metaclasses = """
-scons: warning: memoization is not supported in this version of Python \\(%s\\)
-""" % reason
-
- expect_no_metaclasses = expect_no_metaclasses + TestSCons.file_expr
-
- def run_and_check(test, args, desc):
- test.run(arguments = args, stderr = expect_no_metaclasses)
- test.must_not_contain_any_line(test.stdout(), expect)
-
-
for args in ['-h --debug=memoizer', '--debug=memoizer']:
- run_and_check(test, args, "command line '%s'" % args)
+ test.run(arguments = args)
+ test.must_contain_any_line(test.stdout(), expect)
test.must_match('file.out', "file.in\n")
@@ -111,7 +71,9 @@ test.unlink("file.out")
os.environ['SCONSFLAGS'] = '--debug=memoizer'
-run_and_check(test, '', 'SCONSFLAGS=--debug=memoizer')
+test.run(arguments = '')
+
+test.must_contain_any_line(test.stdout(), expect)
test.must_match('file.out', "file.in\n")