[Python-checkins] cpython: Use directly _PyObject_GenericSetAttrWithDict()

victor.stinner python-checkins at python.org
Mon Dec 5 12:25:27 EST 2016


https://hg.python.org/cpython/rev/90d318d40a83
changeset:   105465:90d318d40a83
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Dec 05 18:23:27 2016 +0100
summary:
  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().

files:
  Objects/typeobject.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3082,7 +3082,7 @@
             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);
 }

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list