File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5271,11 +5271,11 @@ static PyNumberMethods dict_as_number = {
52715271 .nb_inplace_or = _PyDict_IOr ,
52725272};
52735273
5274- static PyObject *
5275- dict_new_untracked (PyTypeObject * type )
5274+ static PyObject *
5275+ anydict_new_untracked (PyTypeObject * type )
52765276{
52775277 assert (type != NULL );
5278- // dict subclasses must implement the GC protocol
5278+ // dict and frozendict subclasses must implement the GC protocol
52795279 assert (_PyType_IS_GC (type ));
52805280
52815281 PyObject * self = _PyType_AllocNoTrack (type , 0 );
@@ -5294,6 +5294,14 @@ dict_new_untracked(PyTypeObject *type)
52945294 return self ;
52955295}
52965296
5297+ static PyObject *
5298+ dict_new_untracked (PyTypeObject * type )
5299+ {
5300+ assert (PyObject_IsSubclass ((PyObject * )type , (PyObject * )& PyDict_Type ));
5301+
5302+ return anydict_new_untracked (type );
5303+ }
5304+
52975305static PyObject *
52985306dict_new (PyTypeObject * type , PyObject * Py_UNUSED (args ), PyObject * Py_UNUSED (kwds ))
52995307{
@@ -8409,7 +8417,9 @@ frozendict_hash(PyObject *op)
84098417static PyObject *
84108418frozendict_new_untracked (PyTypeObject * type )
84118419{
8412- PyObject * d = dict_new_untracked (type );
8420+ assert (PyObject_IsSubclass ((PyObject * )type , (PyObject * )& PyFrozenDict_Type ));
8421+
8422+ PyObject * d = anydict_new_untracked (type );
84138423 if (d == NULL ) {
84148424 return NULL ;
84158425 }
You can’t perform that action at this time.
0 commit comments