summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2011-01-13 21:36:05 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2011-01-13 21:36:05 (GMT)
commit68fcd2b14042333c40301841406a968564159105 (patch)
tree77c19dea11254d1d4aca26387d7a58a1af61b6f6 /src
parent473278769f74086dd95c1a1640302ad5029ede12 (diff)
downloadSCons-68fcd2b14042333c40301841406a968564159105.zip
SCons-68fcd2b14042333c40301841406a968564159105.tar.gz
SCons-68fcd2b14042333c40301841406a968564159105.tar.bz2
Improve error messages for invalid EnumVariables to include legal values.
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Variables/EnumVariable.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 19a037d..3f16e58 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -8,6 +8,9 @@
RELEASE 2.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
From Gary Oberbrunner:
+ - Improve error message for EnumVariables to show legal values.
+
+ From Gary Oberbrunner:
- Fix Intel compiler to sort versions >9 correctly (esp. on Linux)
From Dmitry R.:
diff --git a/src/engine/SCons/Variables/EnumVariable.py b/src/engine/SCons/Variables/EnumVariable.py
index 71302ee..582be27 100644
--- a/src/engine/SCons/Variables/EnumVariable.py
+++ b/src/engine/SCons/Variables/EnumVariable.py
@@ -47,7 +47,7 @@ import SCons.Errors
def _validator(key, val, env, vals):
if not val in vals:
raise SCons.Errors.UserError(
- 'Invalid value for option %s: %s' % (key, val))
+ 'Invalid value for option %s: %s. Valid values are: %s' % (key, val, vals))
def EnumVariable(key, help, default, allowed_values, map={}, ignorecase=0):