Skip to content

Commit aaf2b0a

Browse files
committed
workaround for missing ctypes
1 parent 534939e commit aaf2b0a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/support/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ def dec(*args, **kwargs):
519519
SOCK_MAX_SIZE = 16 * 1024 * 1024 + 1
520520

521521
def _have_ieee_doubles():
522-
import ctypes
523522
import math
524523
# Check parameters for encoding of floats; a quick exit
525524
# if they aren't same as for IEC 60559 doubles. Check
@@ -534,6 +533,10 @@ def _have_ieee_doubles():
534533
or sys.float_info.max_10_exp != 308
535534
or not math.issubnormal(math.nextafter(0, 1))):
536535
return False
536+
try:
537+
import ctypes
538+
except ImportError:
539+
return True
537540
# We attempt to determine if this machine is using IEC
538541
# floating-point formats by peering at the bits of some
539542
# carefully chosen value. Assume that integer and

0 commit comments

Comments
 (0)