Skip to content

Commit

Permalink
fix echo of numpy.number values
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Apr 4, 2019
1 parent acffc81 commit 333bc94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rosidl_runtime_py/rosidl_runtime_py/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ def _convert_value(value, truncate_length=None):
# Don't truncate keys because that could result in key collisions and data loss
new_value[_convert_value(k)] = _convert_value(v, truncate_length=truncate_length)
value = new_value
elif (
not any(isinstance(value, t) for t in (bool, float, int, numpy.number))
):
elif isinstance(value, numpy.number):
value = value.item()
elif not any(isinstance(value, t) for t in (bool, float, int)):
# Assuming value is a message since it is neither a collection nor a primitive type
value = message_to_ordereddict(value, truncate_length=truncate_length)
return value

0 comments on commit 333bc94

Please sign in to comment.