From: Victor Stinner Date: Mon, 5 Dec 2016 17:23:27 +0000 (+0100) Subject: Use directly _PyObject_GenericSetAttrWithDict() X-Git-Tag: v3.7.0a1~1840 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9083eb6aac6e0aa0eb1dee9bc535538de4125fcd;p=thirdparty%2FPython%2Fcpython.git Use directly _PyObject_GenericSetAttrWithDict() Modify type_setattro() to call directly _PyObject_GenericSetAttrWithDict() instead of PyObject_GenericSetAttr(). PyObject_GenericSetAttr() is a thin wrapper to _PyObject_GenericSetAttrWithDict(). --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index d9699ef1ba05..f3e718b5e60b 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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); }