forked from QubesOS/qubes-vmm-xen
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch-0002-python-drop-tp_getattr-implementation.patch
73 lines (66 loc) · 2.75 KB
/
patch-0002-python-drop-tp_getattr-implementation.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From 77b14de386b5cbc6f0b2f16e9ebdc71c485b37c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
Date: Fri, 17 Feb 2017 03:24:16 +0100
Subject: [PATCH 2/7] python: drop tp_getattr implementation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Cc: Marek Marczykowski-Górecki <[email protected]>
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 <[email protected]>
---
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