From d24a36a02a994b4a5755e6bc55065bac94c8971a Mon Sep 17 00:00:00 2001 From: mwojcik Date: Thu, 19 May 2022 15:25:20 +0800 Subject: [PATCH] comm_mgmt: fix read_expect --- artiq/coredevice/comm_mgmt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/artiq/coredevice/comm_mgmt.py b/artiq/coredevice/comm_mgmt.py index 539643751..9833d7520 100644 --- a/artiq/coredevice/comm_mgmt.py +++ b/artiq/coredevice/comm_mgmt.py @@ -110,9 +110,10 @@ class CommMgmt: return ty def _read_expect(self, ty): - if self._read_header() != ty: + header = self._read_header() + if header != ty: raise IOError("Incorrect reply from device: {} (expected {})". - format(self._read_type, ty)) + format(header, ty)) def _read_int32(self): (value, ) = struct.unpack(self.endian + "l", self._read(4))