forked from M-Labs/artiq
Also serialize numpy.int{32,64} like int in RPC return values.
Fixes #555.
This commit is contained in:
parent
f2502026bf
commit
e75002a109
|
@ -396,11 +396,13 @@ class CommGeneric:
|
||||||
lambda: "bool")
|
lambda: "bool")
|
||||||
self._write_int8(value)
|
self._write_int8(value)
|
||||||
elif tag == "i":
|
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")
|
lambda: "32-bit int")
|
||||||
self._write_int32(value)
|
self._write_int32(value)
|
||||||
elif tag == "I":
|
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")
|
lambda: "64-bit int")
|
||||||
self._write_int64(value)
|
self._write_int64(value)
|
||||||
elif tag == "f":
|
elif tag == "f":
|
||||||
|
|
Loading…
Reference in New Issue