[3.13] GH-119462: Enforce invariants of type versioning. Backport of GH-120731. (#120748)

* Remove uses of Py_TPFLAGS_VALID_VERSION_TAG
This commit is contained in:
Mark Shannon 2024-06-20 15:09:32 +01:00 committed by GitHub
parent d0a5e40f01
commit b8fd80f91b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 68 additions and 86 deletions

View file

@ -2415,7 +2415,7 @@ type_assign_specific_version_unsafe(PyObject *self, PyObject *args)
}
assert(!PyType_HasFeature(type, Py_TPFLAGS_IMMUTABLETYPE));
type->tp_version_tag = version;
type->tp_flags |= Py_TPFLAGS_VALID_VERSION_TAG;
type->tp_versions_used++;
Py_RETURN_NONE;
}