Skip to content

Commit 07d66cb

Browse files
ctypes.test.test_callbacks.Callbacks.test_i38748_stackCorruption: Only mark this test as an expected failure on 32 bit (x86).
1 parent cd91426 commit 07d66cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/ctypes/test/test_callbacks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import functools
23
import unittest
34
from test import support
@@ -146,7 +147,6 @@ def __del__(self):
146147
gc.collect()
147148
CFUNCTYPE(None)(lambda x=Nasty(): None)
148149

149-
@unittest.expectedFailure
150150
@need_symbol('WINFUNCTYPE')
151151
def test_i38748_stackCorruption(self):
152152
callback_funcType = WINFUNCTYPE(c_long, c_long, c_longlong)
@@ -158,6 +158,9 @@ def callback(a, b):
158158
dll = cdll[_ctypes_test.__file__]
159159
# With no fix for i38748, the next line will raise OSError and cause the test to fail.
160160
self.assertEqual(dll._test_i38748_runCallback(callback, 5, 10), 15)
161+
# Mark the above test as an expected failure on 32 bit (x86)
162+
if (sys.maxsize + 1) == 2**31: # 32 bit
163+
test_i38748_stackCorruption = unittest.expectedFailure(test_i38748_stackCorruption)
161164

162165
@need_symbol('WINFUNCTYPE')
163166
class StdcallCallbacks(Callbacks):

0 commit comments

Comments
 (0)