38
38
# SOFTWARE.
39
39
40
40
import sys
41
+ from unittest import skipIf
41
42
42
43
from . import CPyExtType , CPyExtTestCase , CPyExtFunction , unhandled_error_compare , assert_raises
43
44
44
45
__dir__ = __file__ .rpartition ("/" )[0 ]
46
+ is_windows = sys .platform == "win32"
45
47
46
48
47
49
def _reference_bytes (args ):
@@ -328,10 +330,9 @@ def test_managed_class_with_native_base(self):
328
330
NativeModule = CPyExtType ("NativeModule_" ,
329
331
'''
330
332
PyTypeObject NativeBase_Type = {
331
- PyVarObject_HEAD_INIT(&PyType_Type , 0)
333
+ .ob_base = PyVarObject_HEAD_INIT(NULL , 0)
332
334
.tp_name = "NativeModule_.NativeBase",
333
335
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
334
- .tp_base = &PyModule_Type,
335
336
};
336
337
337
338
static PyObject* get_NativeBase_type(PyObject* cls) {
@@ -342,6 +343,8 @@ def test_managed_class_with_native_base(self):
342
343
tp_methods = '''{"get_NativeBase_type", (PyCFunction)get_NativeBase_type, METH_NOARGS | METH_CLASS, ""}''' ,
343
344
ready_code = '''
344
345
/* testing lazy type initialization */
346
+ NativeBase_Type.tp_base = &PyModule_Type; // because of MSVC..
347
+ NativeBase_Type.ob_base.ob_base.ob_type = &PyType_Type;
345
348
// if (PyType_Ready(&NativeBase_Type) < 0)
346
349
// return NULL;
347
350
''' ,
@@ -1424,6 +1427,7 @@ def test_take_ownership(self):
1424
1427
obj .clear_value ()
1425
1428
assert value == (1 , 2 , 3 , "hello" , "world" , dummy )
1426
1429
1430
+ @skipIf (is_windows ) # GR-52900
1427
1431
def test_async_slots (self ):
1428
1432
import asyncio , types , functools
1429
1433
TestTpAsync = CPyExtType ("TestTpAsync" ,
0 commit comments