File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -574,14 +574,16 @@ _PyType_GetMRO(PyTypeObject *self)
574574static inline void
575575set_tp_mro (PyTypeObject * self , PyObject * mro , int initial )
576576{
577- assert (PyTuple_CheckExact (mro ));
578- if (self -> tp_flags & _Py_TPFLAGS_STATIC_BUILTIN ) {
579- // XXX tp_mro can probably be statically allocated for each
580- // static builtin type.
581- assert (initial );
582- assert (self -> tp_mro == NULL );
583- /* Other checks are done via set_tp_bases. */
584- _Py_SetImmortal (mro );
577+ if (mro != NULL ) {
578+ assert (PyTuple_CheckExact (mro ));
579+ if (self -> tp_flags & _Py_TPFLAGS_STATIC_BUILTIN ) {
580+ // XXX tp_mro can probably be statically allocated for each
581+ // static builtin type.
582+ assert (initial );
583+ assert (self -> tp_mro == NULL );
584+ /* Other checks are done via set_tp_bases. */
585+ _Py_SetImmortal (mro );
586+ }
585587 }
586588 self -> tp_mro = mro ;
587589}
You can’t perform that action at this time.
0 commit comments