Skip to content

Commit 907bfb1

Browse files
committed
+ use struct
1 parent aaf2b0a commit 907bfb1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/support/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,11 @@ def dec(*args, **kwargs):
520520

521521
def _have_ieee_doubles():
522522
import math
523+
import struct
523524
# Check parameters for encoding of floats; a quick exit
524525
# if they aren't same as for IEC 60559 doubles. Check
525526
# also that subnormals are present.
526-
if (ctypes.sizeof(ctypes.c_double) != 8
527+
if (struct.calcsize('d') != 8
527528
or sys.float_info.radix != 2
528529
or sys.float_info.mant_dig != 53
529530
or sys.float_info.dig != 15

0 commit comments

Comments
 (0)