Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-misc/mugshot/files/, x11-misc/mugshot/
Date: Mon, 24 Aug 2020 22:34:05
Message-Id: 1598308379.f66e7565d64dc115843848fe50322778c2db2ec8.conikost@gentoo
1 commit: f66e7565d64dc115843848fe50322778c2db2ec8
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 24 22:03:22 2020 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 24 22:32:59 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f66e7565
7
8 x11-misc/mugshot: add python3.9 support
9
10 Package-Manager: Portage-3.0.4, Repoman-3.0.1
11 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
12
13 .../mugshot/files/mugshot-0.4.2-python39.patch | 36 ++++++++++++++++++++++
14 x11-misc/mugshot/mugshot-0.4.2-r1.ebuild | 4 ++-
15 2 files changed, 39 insertions(+), 1 deletion(-)
16
17 diff --git a/x11-misc/mugshot/files/mugshot-0.4.2-python39.patch b/x11-misc/mugshot/files/mugshot-0.4.2-python39.patch
18 new file mode 100644
19 index 00000000000..b0443f7a3d3
20 --- /dev/null
21 +++ b/x11-misc/mugshot/files/mugshot-0.4.2-python39.patch
22 @@ -0,0 +1,36 @@
23 +From 643b3d005a8865c961b836aeae4c1f76711646e9 Mon Sep 17 00:00:00 2001
24 +From: Conrad Kostecki <conrad@××××××××.com>
25 +Date: Mon, 24 Aug 2020 23:58:10 +0200
26 +Subject: [PATCH] Add python3.9 compatiblity
27 +
28 +Starting with python3.9, launching of mugshot will fail,
29 +as getiterator() been deprecated since Python 2.7,
30 +and has been removed in Python 3.9. Using iter() will fix that.
31 +
32 +Signed-off-by: Conrad Kostecki <conrad@××××××××.com>
33 +---
34 + mugshot_lib/Builder.py | 4 ++--
35 + 1 file changed, 2 insertions(+), 2 deletions(-)
36 +
37 +diff --git a/mugshot_lib/Builder.py b/mugshot_lib/Builder.py
38 +index 7297541..6c08d70 100644
39 +--- a/mugshot_lib/Builder.py
40 ++++ b/mugshot_lib/Builder.py
41 +@@ -89,7 +89,7 @@ def add_from_file(self, filename):
42 + tree = ElementTree()
43 + tree.parse(filename)
44 +
45 +- ele_widgets = tree.getiterator("object")
46 ++ ele_widgets = tree.iter("object")
47 + for ele_widget in ele_widgets:
48 + name = ele_widget.attrib['id']
49 + widget = self.get_object(name)
50 +@@ -111,7 +111,7 @@ def add_from_file(self, filename):
51 + if connections:
52 + self.connections.extend(connections)
53 +
54 +- ele_signals = tree.getiterator("signal")
55 ++ ele_signals = tree.iter("signal")
56 + for ele_signal in ele_signals:
57 + self.glade_handler_dict.update(
58 + {ele_signal.attrib["handler"]: None})
59
60 diff --git a/x11-misc/mugshot/mugshot-0.4.2-r1.ebuild b/x11-misc/mugshot/mugshot-0.4.2-r1.ebuild
61 index c547ba1e953..a39fccdd02a 100644
62 --- a/x11-misc/mugshot/mugshot-0.4.2-r1.ebuild
63 +++ b/x11-misc/mugshot/mugshot-0.4.2-r1.ebuild
64 @@ -4,7 +4,7 @@
65 EAPI=7
66
67 DISTUTILS_USE_SETUPTOOLS="no"
68 -PYTHON_COMPAT=( python3_{6,7,8} )
69 +PYTHON_COMPAT=( python3_{6..9} )
70
71 inherit distutils-r1 gnome2-utils xdg-utils
72
73 @@ -59,6 +59,8 @@ BDEPEND="
74
75 S="${WORKDIR}/${PN}-${P}"
76
77 +PATCHES=( "${FILESDIR}/${PN}-0.4.2-python39.patch" )
78 +
79 python_install() {
80 distutils-r1_python_install