From 6195b1d3a0d74b5587d62be425d2c3175331d10e Mon Sep 17 00:00:00 2001 From: pca006132 Date: Fri, 4 Sep 2020 13:49:22 +0800 Subject: [PATCH] rpc: fixed _write_bool Closes #1519 --- artiq/coredevice/comm_kernel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/coredevice/comm_kernel.py b/artiq/coredevice/comm_kernel.py index babf035b3..98211d592 100644 --- a/artiq/coredevice/comm_kernel.py +++ b/artiq/coredevice/comm_kernel.py @@ -316,7 +316,7 @@ class CommKernel: self._write(self.pack_float64(value)) def _write_bool(self, value): - self._write(1 if value == True else 0) + self._write(b'\x01' if value else b'\x00') def _write_bytes(self, value): self._write_int32(len(value)) @@ -425,7 +425,7 @@ class CommKernel: elif tag == "b": check(isinstance(value, bool), lambda: "bool") - self._write_int8(value) + self._write_bool(value) elif tag == "i": check(isinstance(value, (int, numpy.int32)) and (-2**31 < value < 2**31-1),