Skip to content

Commit f2e3f8e

Browse files
committed
+1
1 parent c5b52c0 commit f2e3f8e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Lib/test/test_ctypes/test_byteswap.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,14 @@ def test_endian_float_complex(self):
178178
self.assertIs(c_float_complex.__ctype_le__.__ctype_be__,
179179
c_float_complex)
180180
s = c_float_complex(math.pi+1j)
181-
self.assertEqual(bin(struct.pack("F", math.pi+1j)), bin(s))
181+
self.assertEqual(bin(struct.pack("Zf", math.pi+1j)), bin(s))
182182
self.assertAlmostEqual(s.value, math.pi+1j, places=6)
183183
s = c_float_complex.__ctype_le__(math.pi+1j)
184184
self.assertAlmostEqual(s.value, math.pi+1j, places=6)
185-
self.assertEqual(bin(struct.pack("<F", math.pi+1j)), bin(s))
185+
self.assertEqual(bin(struct.pack("<Zf", math.pi+1j)), bin(s))
186186
s = c_float_complex.__ctype_be__(math.pi+1j)
187187
self.assertAlmostEqual(s.value, math.pi+1j, places=6)
188-
self.assertEqual(bin(struct.pack(">F", math.pi+1j)), bin(s))
188+
self.assertEqual(bin(struct.pack(">Zf", math.pi+1j)), bin(s))
189189

190190
@unittest.skipUnless(hasattr(ctypes, 'c_double_complex'), "No complex types")
191191
def test_endian_double_complex(self):
@@ -199,14 +199,14 @@ def test_endian_double_complex(self):
199199
self.assertIs(c_double_complex.__ctype_le__.__ctype_be__,
200200
c_double_complex)
201201
s = c_double_complex(math.pi+1j)
202-
self.assertEqual(bin(struct.pack("D", math.pi+1j)), bin(s))
202+
self.assertEqual(bin(struct.pack("Zd", math.pi+1j)), bin(s))
203203
self.assertAlmostEqual(s.value, math.pi+1j, places=6)
204204
s = c_double_complex.__ctype_le__(math.pi+1j)
205205
self.assertAlmostEqual(s.value, math.pi+1j, places=6)
206-
self.assertEqual(bin(struct.pack("<D", math.pi+1j)), bin(s))
206+
self.assertEqual(bin(struct.pack("<Zd", math.pi+1j)), bin(s))
207207
s = c_double_complex.__ctype_be__(math.pi+1j)
208208
self.assertAlmostEqual(s.value, math.pi+1j, places=6)
209-
self.assertEqual(bin(struct.pack(">D", math.pi+1j)), bin(s))
209+
self.assertEqual(bin(struct.pack(">Zd", math.pi+1j)), bin(s))
210210

211211
def test_endian_other(self):
212212
self.assertIs(c_byte.__ctype_le__, c_byte)

0 commit comments

Comments
 (0)