File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2922,20 +2922,12 @@ Instance_New(PyObject *cls, PyObject *args) {
29222922 UNLESS (__getinitargs__ = PyObject_GetAttr (cls , __getinitargs___str )) {
29232923 /* We have a class with no __getinitargs__, so bypass usual
29242924 construction */
2925- PyInstanceObject * inst ;
2925+ PyObject * inst ;
29262926
29272927 PyErr_Clear ();
2928- UNLESS (inst = PyObject_New ( PyInstanceObject , & PyInstance_Type ))
2928+ UNLESS (inst = PyInstance_NewRaw ( cls , NULL ))
29292929 goto err ;
2930- inst -> in_class = (PyClassObject * )cls ;
2931- Py_INCREF (cls );
2932- UNLESS (inst -> in_dict = PyDict_New ()) {
2933- inst = (PyInstanceObject * ) PyObject_AS_GC (inst );
2934- PyObject_DEL (inst );
2935- goto err ;
2936- }
2937- PyObject_GC_Init (inst );
2938- return (PyObject * )inst ;
2930+ return inst ;
29392931 }
29402932 Py_DECREF (__getinitargs__ );
29412933 }
You can’t perform that action at this time.
0 commit comments