2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 19:28:26 +08:00

language/environment: BooleanValue: fix type detection

Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
This commit is contained in:
Etienne Wodey 2020-04-03 18:19:46 +02:00 committed by Sébastien Bourdeauducq
parent 9b03a365ed
commit 90d08988b2

View File

@ -54,7 +54,6 @@ class PYONValue(_SimpleArgProcessor):
def __init__(self, default=NoDefault):
# Override the _SimpleArgProcessor init, as list defaults are valid
# PYON values
# default stays decoded
if default is not NoDefault:
self.default_value = default
@ -71,12 +70,9 @@ class PYONValue(_SimpleArgProcessor):
class BooleanValue(_SimpleArgProcessor):
"""A boolean argument."""
def process(self, x):
if x is True:
return True
elif x is False:
return False
else:
if type(x) != bool:
raise ValueError("Invalid BooleanValue value")
return x
class EnumerationValue(_SimpleArgProcessor):