]> xenbits.xensource.com Git - xen.git/commitdiff
python: drop tp_getattr implementation
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Thu, 23 Feb 2017 10:48:22 +0000 (11:48 +0100)
committerWei Liu <wei.liu2@citrix.com>
Thu, 23 Feb 2017 13:11:12 +0000 (13:11 +0000)
tp_getattr method of type object is deprecated already in Python2 and
gone in Python3. Default implementation does the same as this custom one.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/python/xen/lowlevel/xc/xc.c
tools/python/xen/lowlevel/xs/xs.c

index 6dcfb0a55602aecdf1c37db62b2db6ca9c775cb4..c8ffbe44a76cef16af76ba70a6ff37046a048a61 100644 (file)
@@ -2640,11 +2640,6 @@ static PyMethodDef pyxc_methods[] = {
 };
 
 
-static PyObject *PyXc_getattr(PyObject *obj, char *name)
-{
-    return Py_FindMethod(pyxc_methods, obj, name);
-}
-
 static PyObject *PyXc_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
     XcObject *self = (XcObject *)type->tp_alloc(type, 0);
@@ -2686,7 +2681,7 @@ static PyTypeObject PyXcType = {
     0,
     (destructor)PyXc_dealloc,     /* tp_dealloc        */
     NULL,                         /* tp_print          */
-    PyXc_getattr,                 /* tp_getattr        */
+    NULL,                         /* tp_getattr        */
     NULL,                         /* tp_setattr        */
     NULL,                         /* tp_compare        */
     NULL,                         /* tp_repr           */
index 5772f4b1626493d5143b70da704cc8c0db991216..e9eef7380c0b22e6753a1490881ec5c1a1596a32 100644 (file)
@@ -870,11 +870,6 @@ static PyMethodDef xshandle_methods[] = {
     { NULL /* Sentinel. */ },
 };
 
-static PyObject *xshandle_getattr(PyObject *self, char *name)
-{
-    return Py_FindMethod(xshandle_methods, self, name);
-}
-
 static PyObject *
 xshandle_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
@@ -938,7 +933,7 @@ static PyTypeObject xshandle_type = {
     0,
     (destructor)xshandle_dealloc, /* tp_dealloc        */
     NULL,                         /* tp_print          */
-    xshandle_getattr,             /* tp_getattr        */
+    NULL,                         /* tp_getattr        */
     NULL,                         /* tp_setattr        */
     NULL,                         /* tp_compare        */
     NULL,                         /* tp_repr           */