From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: xen-devel@lists.xen.org
Cc: "Wei Liu" <wei.liu2@citrix.com>,
"Ian Jackson" <ian.jackson@eu.citrix.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Subject: [PATCH 2/8] python: drop tp_getattr implementation
Date: Thu, 23 Feb 2017 11:48:22 +0100 [thread overview]
Message-ID: <1487846908-21462-3-git-send-email-marmarek@invisiblethingslab.com> (raw)
In-Reply-To: <1487846908-21462-1-git-send-email-marmarek@invisiblethingslab.com>
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>
---
tools/python/xen/lowlevel/xc/xc.c | 7 +------
tools/python/xen/lowlevel/xs/xs.c | 7 +------
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 7fbead5..109ef57 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -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 */
diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c
index 5772f4b..e9eef73 100644
--- a/tools/python/xen/lowlevel/xs/xs.c
+++ b/tools/python/xen/lowlevel/xs/xs.c
@@ -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 */
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-02-23 10:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 10:48 [PATCH 0/8] Python 3 bindings Marek Marczykowski-Górecki
2017-02-23 10:48 ` [PATCH 1/8] python: check return value of PyErr_NewException Marek Marczykowski-Górecki
2017-02-23 10:48 ` Marek Marczykowski-Górecki [this message]
2017-02-23 10:48 ` [PATCH 3/8] python: use Py_TYPE instead of looking directly into PyObject_HEAD Marek Marczykowski-Górecki
2017-02-23 10:48 ` [PATCH 4/8] python: initialize specific fields of PyTypeObject Marek Marczykowski-Górecki
2017-02-23 10:48 ` [PATCH 5/8] python: use PyBytes/PyUnicode instead of PyString Marek Marczykowski-Górecki
2017-02-23 10:48 ` [PATCH 6/8] python: use PyLong_* for constructing 'int' type in Python3 Marek Marczykowski-Górecki
2017-02-23 10:48 ` [PATCH 7/8] python: adjust module initalization for Python3 Marek Marczykowski-Górecki
2017-02-23 10:48 ` [PATCH 8/8] python: handle long type in scripts Marek Marczykowski-Górecki
2017-02-23 11:23 ` [PATCH 0/8] Python 3 bindings Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487846908-21462-3-git-send-email-marmarek@invisiblethingslab.com \
--to=marmarek@invisiblethingslab.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).