summaryrefslogtreecommitdiff
path: root/optik_ext.py
diff options
context:
space:
mode:
authorFabrice Douchant <Fabrice.Douchant@logilab.fr>2008-10-29 10:41:22 +0100
committerFabrice Douchant <Fabrice.Douchant@logilab.fr>2008-10-29 10:41:22 +0100
commitadf3c9846945356098aaa05f893308f5e691a879 (patch)
treeae1e16109f87f9f021424dbfde6a9a53f2e921f2 /optik_ext.py
parentb1d1d51d55f9a42c19f370a40ef07cea7737c197 (diff)
downloadlogilab-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.py6
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):