Skip to content

Commit

Permalink
Also serialize numpy.int{32,64} like int in RPC return values.
Browse files Browse the repository at this point in the history
Fixes #555.
whitequark authored and sbourdeauducq committed Sep 9, 2016
1 parent f250202 commit e75002a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions artiq/coredevice/comm_generic.py
Original file line number Diff line number Diff line change
@@ -396,11 +396,13 @@ def check(cond, expected):
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":

0 comments on commit e75002a

Please sign in to comment.