Gentoo Archives: gentoo-commits

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