diff options
author | Fabrice Douchant <Fabrice.Douchant@logilab.fr> | 2008-10-29 10:41:22 +0100 |
---|---|---|
committer | Fabrice Douchant <Fabrice.Douchant@logilab.fr> | 2008-10-29 10:41:22 +0100 |
commit | adf3c9846945356098aaa05f893308f5e691a879 (patch) | |
tree | ae1e16109f87f9f021424dbfde6a9a53f2e921f2 /optik_ext.py | |
parent | b1d1d51d55f9a42c19f370a40ef07cea7737c197 (diff) | |
download | logilab-common-adf3c9846945356098aaa05f893308f5e691a879.tar.gz |
[#2446] changing yn option in common.configuration : does not take y/n value anymore in sys.args.
Diffstat (limited to 'optik_ext.py')
-rw-r--r-- | optik_ext.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/optik_ext.py b/optik_ext.py index 123a2a6..ffaf1ba 100644 --- a/optik_ext.py +++ b/optik_ext.py @@ -78,13 +78,13 @@ def check_yn(option, opt, value): """check a yn value return true for yes and false for no """ - if isinstance(value, int): - return bool(value) if value in ('y', 'yes'): return True if value in ('n', 'no'): return False - msg = "option %s: invalid yn value %r, should be in (y, yes, n, no)" + if value in (True, False): + return value + msg = "option %s: invalid yn value %r, should be True or False" raise OptionValueError(msg % (opt, value)) def check_named(option, opt, value): |