Skip to content

Commit cbfbf05

Browse files
committed
Revert "XXX try to revert win32 WA"
This reverts commit b461b81.
1 parent b461b81 commit cbfbf05

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Lib/test/test_capi/test_float.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ def test_pack_unpack_roundtrip_nans(self):
187187
for _ in range(100):
188188
for size in (2, 4, 8):
189189
sign = random.randint(0, 1)
190-
quiet = random.randint(0, 1)
190+
if sys.platform != 'win32':
191+
quiet = random.randint(0, 1)
192+
else:
193+
quiet = 1 # doesn't work for sNaN's here
191194
if size == 8:
192195
payload = random.randint(0 if quiet else 1, 1<<50)
193196
i = (sign<<63) + (0x7ff<<52) + (quiet<<51) + payload

Lib/test/test_struct.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,9 @@ def test_half_float(self):
936936
self.assertTrue(math.isnan(struct.unpack('>e', bits[::-1])[0]))
937937

938938
# Check round-trip for NaN's:
939+
if (sys.platform == 'win32'
940+
and not (int.from_bytes(bits[::-1]) & (1<<9))):
941+
continue # doesn't work for sNaN's here
939942
nan = struct.unpack('<e', bits)[0]
940943
self.assertEqual(struct.pack('<e', nan), bits)
941944
nan = struct.unpack('>e', bits[::-1])[0]

0 commit comments

Comments
 (0)