]> granicus.if.org Git - python/commitdiff
Use directly _PyObject_GenericSetAttrWithDict()
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 5 Dec 2016 17:23:27 +0000 (18:23 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 5 Dec 2016 17:23:27 +0000 (18:23 +0100)
Modify type_setattro() to call directly _PyObject_GenericSetAttrWithDict()
instead of PyObject_GenericSetAttr().

PyObject_GenericSetAttr() is a thin wrapper to
_PyObject_GenericSetAttrWithDict().

Objects/typeobject.c

index d9699ef1ba05c40d30bd7737b8cbe5032f499a67..f3e718b5e60b92f512dd6bb3fc6310495cfdd184 100644 (file)
@@ -3082,7 +3082,7 @@ type_setattro(PyTypeObject *type, PyObject *name, PyObject *value)
             type->tp_name);
         return -1;
     }
-    if (PyObject_GenericSetAttr((PyObject *)type, name, value) < 0)
+    if (_PyObject_GenericSetAttrWithDict((PyObject *)type, name, value, NULL) < 0)
         return -1;
     return update_slot(type, name);
 }