forked from M-Labs/artiq
language/environment: BooleanValue: fix type detection
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
This commit is contained in:
parent
9b03a365ed
commit
90d08988b2
|
@ -54,7 +54,6 @@ class PYONValue(_SimpleArgProcessor):
|
||||||
def __init__(self, default=NoDefault):
|
def __init__(self, default=NoDefault):
|
||||||
# Override the _SimpleArgProcessor init, as list defaults are valid
|
# Override the _SimpleArgProcessor init, as list defaults are valid
|
||||||
# PYON values
|
# PYON values
|
||||||
# default stays decoded
|
|
||||||
if default is not NoDefault:
|
if default is not NoDefault:
|
||||||
self.default_value = default
|
self.default_value = default
|
||||||
|
|
||||||
|
@ -71,12 +70,9 @@ class PYONValue(_SimpleArgProcessor):
|
||||||
class BooleanValue(_SimpleArgProcessor):
|
class BooleanValue(_SimpleArgProcessor):
|
||||||
"""A boolean argument."""
|
"""A boolean argument."""
|
||||||
def process(self, x):
|
def process(self, x):
|
||||||
if x is True:
|
if type(x) != bool:
|
||||||
return True
|
|
||||||
elif x is False:
|
|
||||||
return False
|
|
||||||
else:
|
|
||||||
raise ValueError("Invalid BooleanValue value")
|
raise ValueError("Invalid BooleanValue value")
|
||||||
|
return x
|
||||||
|
|
||||||
|
|
||||||
class EnumerationValue(_SimpleArgProcessor):
|
class EnumerationValue(_SimpleArgProcessor):
|
||||||
|
|
Loading…
Reference in New Issue