[Python-checkins] r82318 - in python/branches/py3k: Objects/descrobject.c

benjamin.peterson python-checkins at python.org
Mon Jun 28 05:07:10 CEST 2010


Author: benjamin.peterson
Date: Mon Jun 28 05:07:10 2010
New Revision: 82318

Log:
Merged revisions 82317 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82317 | benjamin.peterson | 2010-06-27 21:58:25 -0500 (Sun, 27 Jun 2010) | 1 line
  
  remove unused last argument to property_copy
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Objects/descrobject.c

Modified: python/branches/py3k/Objects/descrobject.c
==============================================================================
--- python/branches/py3k/Objects/descrobject.c	(original)
+++ python/branches/py3k/Objects/descrobject.c	Mon Jun 28 05:07:10 2010
@@ -1115,7 +1115,7 @@
 } propertyobject;
 
 static PyObject * property_copy(PyObject *, PyObject *, PyObject *,
-                                  PyObject *, PyObject *);
+                                  PyObject *);
 
 static PyMemberDef property_members[] = {
     {"fget", T_OBJECT, offsetof(propertyobject, prop_get), READONLY},
@@ -1132,7 +1132,7 @@
 static PyObject *
 property_getter(PyObject *self, PyObject *getter)
 {
-    return property_copy(self, getter, NULL, NULL, NULL);
+    return property_copy(self, getter, NULL, NULL);
 }
 
 
@@ -1142,7 +1142,7 @@
 static PyObject *
 property_setter(PyObject *self, PyObject *setter)
 {
-    return property_copy(self, NULL, setter, NULL, NULL);
+    return property_copy(self, NULL, setter, NULL);
 }
 
 
@@ -1152,7 +1152,7 @@
 static PyObject *
 property_deleter(PyObject *self, PyObject *deleter)
 {
-    return property_copy(self, NULL, NULL, deleter, NULL);
+    return property_copy(self, NULL, NULL, deleter);
 }
 
 
@@ -1221,11 +1221,10 @@
 }
 
 static PyObject *
-property_copy(PyObject *old, PyObject *get, PyObject *set, PyObject *del,
-                PyObject *doc)
+property_copy(PyObject *old, PyObject *get, PyObject *set, PyObject *del)
 {
     propertyobject *pold = (propertyobject *)old;
-    PyObject *new, *type;
+    PyObject *new, *type, *doc;
 
     type = PyObject_Type(old);
     if (type == NULL)
@@ -1243,15 +1242,12 @@
         Py_XDECREF(del);
         del = pold->prop_del ? pold->prop_del : Py_None;
     }
-    if (doc == NULL || doc == Py_None) {
-        Py_XDECREF(doc);
-        if (pold->getter_doc && get != Py_None) {
-            /* make _init use __doc__ from getter */
-            doc = Py_None;
-        }
-        else {
-            doc = pold->prop_doc ? pold->prop_doc : Py_None;
-        }
+    if (pold->getter_doc && get != Py_None) {
+        /* make _init use __doc__ from getter */
+        doc = Py_None;
+    }
+    else {
+        doc = pold->prop_doc ? pold->prop_doc : Py_None;
     }
 
     new =  PyObject_CallFunction(type, "OOOO", get, set, del, doc);


More information about the Python-checkins mailing list