summaryrefslogtreecommitdiff
path: root/optik_ext.py
diff options
context:
space:
mode:
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 ffaf1ba..123a2a6 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
- if value in (True, False):
- return value
- msg = "option %s: invalid yn value %r, should be True or False"
+ msg = "option %s: invalid yn value %r, should be in (y, yes, n, no)"
raise OptionValueError(msg % (opt, value))
def check_named(option, opt, value):