From 7710836fdb50bf4a604fed7f1d28b82b8ccc99c1 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 21 Jul 2012 09:12:22 -0400 Subject: [PATCH] Use integer division when calculating DynamicStringIndicesDataField count. In Python 3, the floating point division lead to: Traceback (most recent call last): ... File ".../igor/struct.py", line 255, in unpack_data items = [next(iterator) for i in range(self.arg_count)] TypeError: 'numpy.float64' object cannot be interpreted as an integer --- igor/binarywave.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/igor/binarywave.py b/igor/binarywave.py index ab49cdd..513148b 100644 --- a/igor/binarywave.py +++ b/igor/binarywave.py @@ -477,7 +477,7 @@ class DynamicStringIndicesDataField (_DynamicField): bin_header = wave_data['bin_header'] wave_header = wave_data['wave_header'] self.string_indices_size = bin_header['sIndicesSize'] - self.count = self.string_indices_size / 4 + self.count = self.string_indices_size // 4 if self.count: # make sure we're in a text wave assert TYPE_TABLE[wave_header['type']] is None, wave_header self.setup() -- 2.26.2