@@ -324,10 +324,6 @@ PyType_Modified(PyTypeObject *type)
324
324
325
325
Invariants:
326
326
327
- - Py_TPFLAGS_VALID_VERSION_TAG is never set if
328
- Py_TPFLAGS_HAVE_VERSION_TAG is not set (in case of a
329
- bizarre MRO, see type_mro_modified()).
330
-
331
327
- before Py_TPFLAGS_VALID_VERSION_TAG can be set on a type,
332
328
it must first be set on all super types.
333
329
@@ -379,9 +375,6 @@ type_mro_modified(PyTypeObject *type, PyObject *bases) {
379
375
PyObject * mro_meth = NULL ;
380
376
PyObject * type_mro_meth = NULL ;
381
377
382
- if (!_PyType_HasFeature (type , Py_TPFLAGS_HAVE_VERSION_TAG ))
383
- return ;
384
-
385
378
if (custom ) {
386
379
mro_meth = lookup_maybe_method (
387
380
(PyObject * )type , & PyId_mro , & unbound );
@@ -404,17 +397,15 @@ type_mro_modified(PyTypeObject *type, PyObject *bases) {
404
397
assert (PyType_Check (b ));
405
398
cls = (PyTypeObject * )b ;
406
399
407
- if (!_PyType_HasFeature (cls , Py_TPFLAGS_HAVE_VERSION_TAG ) ||
408
- !PyType_IsSubtype (type , cls )) {
400
+ if (!PyType_IsSubtype (type , cls )) {
409
401
goto clear ;
410
402
}
411
403
}
412
404
return ;
413
405
clear :
414
406
Py_XDECREF (mro_meth );
415
407
Py_XDECREF (type_mro_meth );
416
- type -> tp_flags &= ~(Py_TPFLAGS_HAVE_VERSION_TAG |
417
- Py_TPFLAGS_VALID_VERSION_TAG );
408
+ type -> tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG ;
418
409
type -> tp_version_tag = 0 ; /* 0 is not a valid version tag */
419
410
}
420
411
@@ -431,8 +422,6 @@ assign_version_tag(struct type_cache *cache, PyTypeObject *type)
431
422
432
423
if (_PyType_HasFeature (type , Py_TPFLAGS_VALID_VERSION_TAG ))
433
424
return 1 ;
434
- if (!_PyType_HasFeature (type , Py_TPFLAGS_HAVE_VERSION_TAG ))
435
- return 0 ;
436
425
if (!_PyType_HasFeature (type , Py_TPFLAGS_READY ))
437
426
return 0 ;
438
427
@@ -5978,14 +5967,6 @@ type_ready_pre_checks(PyTypeObject *type)
5978
5967
_PyObject_ASSERT ((PyObject * )type , type -> tp_call != NULL );
5979
5968
}
5980
5969
5981
- /* Consistency check for Py_TPFLAGS_HAVE_AM_SEND - flag requires
5982
- * type->tp_as_async->am_send to be present.
5983
- */
5984
- if (type -> tp_flags & Py_TPFLAGS_HAVE_AM_SEND ) {
5985
- _PyObject_ASSERT ((PyObject * )type , type -> tp_as_async != NULL );
5986
- _PyObject_ASSERT ((PyObject * )type , type -> tp_as_async -> am_send != NULL );
5987
- }
5988
-
5989
5970
/* Consistency checks for pattern matching
5990
5971
* Py_TPFLAGS_SEQUENCE and Py_TPFLAGS_MAPPING are mutually exclusive */
5991
5972
_PyObject_ASSERT ((PyObject * )type , (type -> tp_flags & COLLECTION_FLAGS ) != COLLECTION_FLAGS );
0 commit comments