mirror of https://github.com/m-labs/artiq.git
comm_mgmt: fix read_expect
This commit is contained in:
parent
4bdb4c8e11
commit
d24a36a02a
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue