summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2013-03-17 00:43:54 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2013-03-17 00:43:54 (GMT)
commite8f1182787dc7f1187759224830815a85a5e3446 (patch)
tree59b29967d98fea2403c729c0aa31e98d2c39d227 /src
parent1d3de8cda278418e624c7c808e12ab069d514c69 (diff)
parentede4ee9b3306ca546c2f04bcabff9f970ed1cb9a (diff)
downloadSCons-e8f1182787dc7f1187759224830815a85a5e3446.zip
SCons-e8f1182787dc7f1187759224830815a85a5e3446.tar.gz
SCons-e8f1182787dc7f1187759224830815a85a5e3446.tar.bz2
Merged in carandraug/scons (pull request #67).
Added test for CheckContext custom result types. Also allow test.must_match() to take a match type.
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/SConf.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py
index 0506f80..f3a3545 100644
--- a/src/engine/SCons/SConf.py
+++ b/src/engine/SCons/SConf.py
@@ -776,19 +776,16 @@ class CheckContext(object):
self.did_show_result = 0
def Result(self, res):
- """Inform about the result of the test. res may be an integer or a
- string. In case of an integer, the written text will be 'yes' or 'no'.
+ """Inform about the result of the test. If res is not a string, displays
+ 'yes' or 'no' depending on whether res is evaluated as true or false.
The result is only displayed when self.did_show_result is not set.
"""
- if isinstance(res, (int, bool)):
- if res:
- text = "yes"
- else:
- text = "no"
- elif isinstance(res, str):
+ if isinstance(res, str):
text = res
+ elif res:
+ text = "yes"
else:
- raise TypeError("Expected string, int or bool, got " + str(type(res)))
+ text = "no"
if self.did_show_result == 0:
# Didn't show result yet, do it now.