forked from M-Labs/artiq
1
0
Fork 0

comm_mgmt: fix read_expect

This commit is contained in:
mwojcik 2022-05-19 15:25:20 +08:00 committed by Sébastien Bourdeauducq
parent 4bdb4c8e11
commit d24a36a02a
1 changed files with 3 additions and 2 deletions

View File

@ -110,9 +110,10 @@ class CommMgmt:
return ty return ty
def _read_expect(self, 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 {})". raise IOError("Incorrect reply from device: {} (expected {})".
format(self._read_type, ty)) format(header, ty))
def _read_int32(self): def _read_int32(self):
(value, ) = struct.unpack(self.endian + "l", self._read(4)) (value, ) = struct.unpack(self.endian + "l", self._read(4))