summaryrefslogtreecommitdiffstats
path: root/Objects/typeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r--Objects/typeobject.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 840d004..2611404 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -5645,6 +5645,24 @@ _PyType_SetFlags(PyTypeObject *self, unsigned long mask, unsigned long flags)
END_TYPE_LOCK();
}
+int
+_PyType_Validate(PyTypeObject *ty, _py_validate_type validate, unsigned int *tp_version)
+{
+ int err;
+ BEGIN_TYPE_LOCK();
+ err = validate(ty);
+ if (!err) {
+ if(assign_version_tag(_PyInterpreterState_GET(), ty)) {
+ *tp_version = ty->tp_version_tag;
+ }
+ else {
+ err = -1;
+ }
+ }
+ END_TYPE_LOCK();
+ return err;
+}
+
static void
set_flags_recursive(PyTypeObject *self, unsigned long mask, unsigned long flags)
{