From e75002a1097b3d2227de2260b08404aa522e5ed1 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 9 Sep 2016 08:52:13 +0000 Subject: [PATCH] Also serialize numpy.int{32,64} like int in RPC return values. Fixes #555. --- artiq/coredevice/comm_generic.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/artiq/coredevice/comm_generic.py b/artiq/coredevice/comm_generic.py index 24bccbd40..8a8277ac1 100644 --- a/artiq/coredevice/comm_generic.py +++ b/artiq/coredevice/comm_generic.py @@ -396,11 +396,13 @@ class CommGeneric: lambda: "bool") self._write_int8(value) elif tag == "i": - check(isinstance(value, int) and (-2**31 < value < 2**31-1), + check(isinstance(value, (int, numpy.int32)) and + (-2**31 < value < 2**31-1), lambda: "32-bit int") self._write_int32(value) elif tag == "I": - check(isinstance(value, int) and (-2**63 < value < 2**63-1), + check(isinstance(value, (int, numpy.int32, numpy.int64)) and + (-2**63 < value < 2**63-1), lambda: "64-bit int") self._write_int64(value) elif tag == "f":