From: W. Trevor King Date: Sat, 21 Jul 2012 13:12:22 +0000 (-0400) Subject: Use integer division when calculating DynamicStringIndicesDataField count. X-Git-Tag: v0.2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7710836fdb50bf4a604fed7f1d28b82b8ccc99c1;p=igor.git 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 --- 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()