There was an error while loading. Please reload this page.
1 parent 3157786 commit 76f2903Copy full SHA for 76f2903
1 file changed
Lib/test/support/__init__.py
@@ -3484,3 +3484,11 @@ def check_immutable_type(testcase, type):
3484
regex = r'cannot set .* attribute of immutable type'
3485
with testcase.assertRaisesRegex(TypeError, regex):
3486
setattr(type, 'custom_attr', 123)
3487
+
3488
+ try:
3489
+ from _testlimitedcapi import type_getflags, Py_TPFLAGS_IMMUTABLETYPE
3490
+ except ImportError:
3491
+ pass
3492
+ else:
3493
+ flags = type_getflags(type)
3494
+ testcase.assertTrue(flags & Py_TPFLAGS_IMMUTABLETYPE)
0 commit comments