Gentoo Archives: gentoo-portage-dev

From: Mike Gilbert <floppym@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Mike Gilbert <floppym@g.o>
Subject: [gentoo-portage-dev] [PATCH] Drop Python 2 comatibility in extension modules
Date: Thu, 24 Dec 2020 18:14:22
Message-Id: 20201224181406.517100-1-floppym@gentoo.org
1 Signed-off-by: Mike Gilbert <floppym@g.o>
2 ---
3 src/portage_util_file_copy_reflink_linux.c | 10 +---------
4 src/portage_util_libc.c | 10 +---------
5 2 files changed, 2 insertions(+), 18 deletions(-)
6
7 diff --git a/src/portage_util_file_copy_reflink_linux.c b/src/portage_util_file_copy_reflink_linux.c
8 index 352342c06..c6affe57a 100644
9 --- a/src/portage_util_file_copy_reflink_linux.c
10 +++ b/src/portage_util_file_copy_reflink_linux.c
11 @@ -1,4 +1,4 @@
12 -/* Copyright 2017 Gentoo Foundation
13 +/* Copyright 2017-2020 Gentoo Authors
14 * Distributed under the terms of the GNU General Public License v2
15 */
16
17 @@ -25,7 +25,6 @@ static PyMethodDef reflink_linuxMethods[] = {
18 {NULL, NULL, 0, NULL}
19 };
20
21 -#if PY_MAJOR_VERSION >= 3
22 static struct PyModuleDef moduledef = {
23 PyModuleDef_HEAD_INIT,
24 "reflink_linux", /* m_name */
25 @@ -45,13 +44,6 @@ PyInit_reflink_linux(void)
26 m = PyModule_Create(&moduledef);
27 return m;
28 }
29 -#else
30 -PyMODINIT_FUNC
31 -initreflink_linux(void)
32 -{
33 - Py_InitModule("reflink_linux", reflink_linuxMethods);
34 -}
35 -#endif
36
37
38 /**
39 diff --git a/src/portage_util_libc.c b/src/portage_util_libc.c
40 index 977b95474..2a3e624dc 100644
41 --- a/src/portage_util_libc.c
42 +++ b/src/portage_util_libc.c
43 @@ -1,4 +1,4 @@
44 -/* Copyright 2005-2016 Gentoo Foundation
45 +/* Copyright 2005-2020 Gentoo Authors
46 * Distributed under the terms of the GNU General Public License v2
47 */
48
49 @@ -15,7 +15,6 @@ static PyMethodDef LibcMethods[] = {
50 {NULL, NULL, 0, NULL}
51 };
52
53 -#if PY_MAJOR_VERSION >= 3
54 static struct PyModuleDef moduledef = {
55 PyModuleDef_HEAD_INIT,
56 "libc", /* m_name */
57 @@ -35,13 +34,6 @@ PyInit_libc(void)
58 m = PyModule_Create(&moduledef);
59 return m;
60 }
61 -#else
62 -PyMODINIT_FUNC
63 -initlibc(void)
64 -{
65 - Py_InitModule("libc", LibcMethods);
66 -}
67 -#endif
68
69
70 static PyObject *
71 --
72 2.30.0.rc1

Replies