Skip to content

Commit e75002a

Browse files
whitequarksbourdeauducq
whitequark
authored andcommittedSep 9, 2016
Also serialize numpy.int{32,64} like int in RPC return values.
Fixes #555.
1 parent f250202 commit e75002a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

Diff for: ‎artiq/coredevice/comm_generic.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,13 @@ def check(cond, expected):
396396
lambda: "bool")
397397
self._write_int8(value)
398398
elif tag == "i":
399-
check(isinstance(value, int) and (-2**31 < value < 2**31-1),
399+
check(isinstance(value, (int, numpy.int32)) and
400+
(-2**31 < value < 2**31-1),
400401
lambda: "32-bit int")
401402
self._write_int32(value)
402403
elif tag == "I":
403-
check(isinstance(value, int) and (-2**63 < value < 2**63-1),
404+
check(isinstance(value, (int, numpy.int32, numpy.int64)) and
405+
(-2**63 < value < 2**63-1),
404406
lambda: "64-bit int")
405407
self._write_int64(value)
406408
elif tag == "f":

0 commit comments

Comments
 (0)
Please sign in to comment.