1 |
commit: 60e7f4aadb392dcc56d7182a78b7715a114ef3ac |
2 |
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 17 18:10:32 2021 +0000 |
4 |
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 17 18:10:32 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60e7f4aa |
7 |
|
8 |
dev-python/feedparser: enable py3.10 |
9 |
|
10 |
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> |
11 |
|
12 |
dev-python/feedparser/feedparser-6.0.8.ebuild | 8 ++++++-- |
13 |
.../feedparser/files/feedparser-6.0.8-fix-py3.10.patch | 15 +++++++++++++++ |
14 |
2 files changed, 21 insertions(+), 2 deletions(-) |
15 |
|
16 |
diff --git a/dev-python/feedparser/feedparser-6.0.8.ebuild b/dev-python/feedparser/feedparser-6.0.8.ebuild |
17 |
index dceae5fe0ca..4b502ad6931 100644 |
18 |
--- a/dev-python/feedparser/feedparser-6.0.8.ebuild |
19 |
+++ b/dev-python/feedparser/feedparser-6.0.8.ebuild |
20 |
@@ -3,7 +3,7 @@ |
21 |
|
22 |
EAPI=7 |
23 |
|
24 |
-PYTHON_COMPAT=( python3_{8..9} pypy3 ) |
25 |
+PYTHON_COMPAT=( python3_{8..10} pypy3 ) |
26 |
|
27 |
inherit distutils-r1 |
28 |
|
29 |
@@ -23,6 +23,10 @@ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~s390 sparc x86 ~amd64-li |
30 |
|
31 |
RDEPEND="dev-python/sgmllib3k[${PYTHON_USEDEP}]" |
32 |
|
33 |
+PATCHES=( |
34 |
+ "${FILESDIR}/${P}-fix-py3.10.patch" |
35 |
+) |
36 |
+ |
37 |
distutils_enable_tests unittest |
38 |
|
39 |
src_prepare() { |
40 |
@@ -34,5 +38,5 @@ src_prepare() { |
41 |
} |
42 |
|
43 |
python_test() { |
44 |
- "${EPYTHON}" tests/runtests.py || die |
45 |
+ "${EPYTHON}" tests/runtests.py || die "Tests failed with ${EPYTHON}" |
46 |
} |
47 |
|
48 |
diff --git a/dev-python/feedparser/files/feedparser-6.0.8-fix-py3.10.patch b/dev-python/feedparser/files/feedparser-6.0.8-fix-py3.10.patch |
49 |
new file mode 100644 |
50 |
index 00000000000..8f835f37207 |
51 |
--- /dev/null |
52 |
+++ b/dev-python/feedparser/files/feedparser-6.0.8-fix-py3.10.patch |
53 |
@@ -0,0 +1,15 @@ |
54 |
+From: Kurt McKee <contactme@×××××××××.org> |
55 |
+Date: Sat, 12 Jun 2021 15:32:05 -0500 |
56 |
+Subject: [PATCH] Fix a crash that occurs with Python 3.10.0b2 |
57 |
+ |
58 |
+--- a/feedparser/html.py |
59 |
++++ b/feedparser/html.py |
60 |
+@@ -337,7 +337,7 @@ def parse_declaration(self, i): |
61 |
+ |
62 |
+ try: |
63 |
+ return sgmllib.SGMLParser.parse_declaration(self, i) |
64 |
+- except sgmllib.SGMLParseError: |
65 |
++ except (AssertionError, sgmllib.SGMLParseError): |
66 |
+ # Escape the doctype declaration and continue parsing. |
67 |
+ self.handle_data('<') |
68 |
+ return i+1 |