From 3d3ef36e977b5f5a4153b8df6447f3f73e4726e3 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 4 May 2015 16:35:40 +0300 Subject: modstruct: Rename module to "ustruct", to allow full Python-level impl. --- tests/float/float2int.py | 5 ++++- tests/float/float2int_doubleprec.py | 5 ++++- tests/float/float_struct.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'tests/float') diff --git a/tests/float/float2int.py b/tests/float/float2int.py index ca395997c..e9bdf15de 100644 --- a/tests/float/float2int.py +++ b/tests/float/float2int.py @@ -1,6 +1,9 @@ # check cases converting float to int, relying only on single precision float -import struct +try: + import ustruct as struct +except: + import struct # work out configuration values is_64bit = struct.calcsize("P") == 8 diff --git a/tests/float/float2int_doubleprec.py b/tests/float/float2int_doubleprec.py index 63138c0d4..acdc8c69c 100644 --- a/tests/float/float2int_doubleprec.py +++ b/tests/float/float2int_doubleprec.py @@ -1,6 +1,9 @@ # check cases converting float to int, requiring double precision float -import struct +try: + import ustruct as struct +except: + import struct # work out configuration values is_64bit = struct.calcsize("P") == 8 diff --git a/tests/float/float_struct.py b/tests/float/float_struct.py index 8ad0e492c..e55890a2c 100644 --- a/tests/float/float_struct.py +++ b/tests/float/float_struct.py @@ -1,6 +1,9 @@ # test struct package with floats -import struct +try: + import ustruct as struct +except: + import struct i = 1. + 1/2 # TODO: it looks like '=' format modifier is not yet supported -- cgit v1.2.3