bpo-40077: Convert _abc module to use PyType_FromSpec() (GH-19202)

Replace statically allocated types with heap allocated types:
use PyType_FromSpec().

Add a module state to store the _abc_data_type.
Add traverse, clear and free functions to the module.
This commit is contained in:
Dong-hee Na 2020-03-30 23:35:38 +09:00 committed by GitHub
parent ce105541f8
commit 53e4c91725
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 76 additions and 31 deletions

View file

@ -326,7 +326,7 @@ def test_factory(abc_ABCMeta, abc_get_cache_token):
token_old = abc_get_cache_token()
A.register(B)
token_new = abc_get_cache_token()
self.assertNotEqual(token_old, token_new)
self.assertGreater(token_new, token_old)
self.assertTrue(isinstance(b, A))
self.assertTrue(isinstance(b, (A,)))