summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2021-09-17 21:10:32 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2021-09-17 21:10:32 +0300
commit60e7f4aadb392dcc56d7182a78b7715a114ef3ac (patch)
treeabfa50a2aeddc5812a823f59892340b905e292ea
parentdev-python/sgmllib3k: enable py3.10, add tests (diff)
downloadgentoo-60e7f4aadb392dcc56d7182a78b7715a114ef3ac.tar.gz
gentoo-60e7f4aadb392dcc56d7182a78b7715a114ef3ac.tar.bz2
gentoo-60e7f4aadb392dcc56d7182a78b7715a114ef3ac.zip
dev-python/feedparser: enable py3.10
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--dev-python/feedparser/feedparser-6.0.8.ebuild8
-rw-r--r--dev-python/feedparser/files/feedparser-6.0.8-fix-py3.10.patch15
2 files changed, 21 insertions, 2 deletions
diff --git a/dev-python/feedparser/feedparser-6.0.8.ebuild b/dev-python/feedparser/feedparser-6.0.8.ebuild
index dceae5fe0ca..4b502ad6931 100644
--- a/dev-python/feedparser/feedparser-6.0.8.ebuild
+++ b/dev-python/feedparser/feedparser-6.0.8.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{8..9} pypy3 )
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
inherit distutils-r1
@@ -23,6 +23,10 @@ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~s390 sparc x86 ~amd64-li
RDEPEND="dev-python/sgmllib3k[${PYTHON_USEDEP}]"
+PATCHES=(
+ "${FILESDIR}/${P}-fix-py3.10.patch"
+)
+
distutils_enable_tests unittest
src_prepare() {
@@ -34,5 +38,5 @@ src_prepare() {
}
python_test() {
- "${EPYTHON}" tests/runtests.py || die
+ "${EPYTHON}" tests/runtests.py || die "Tests failed with ${EPYTHON}"
}
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
new file mode 100644
index 00000000000..8f835f37207
--- /dev/null
+++ b/dev-python/feedparser/files/feedparser-6.0.8-fix-py3.10.patch
@@ -0,0 +1,15 @@
+From: Kurt McKee <contactme@kurtmckee.org>
+Date: Sat, 12 Jun 2021 15:32:05 -0500
+Subject: [PATCH] Fix a crash that occurs with Python 3.10.0b2
+
+--- a/feedparser/html.py
++++ b/feedparser/html.py
+@@ -337,7 +337,7 @@ def parse_declaration(self, i):
+
+ try:
+ return sgmllib.SGMLParser.parse_declaration(self, i)
+- except sgmllib.SGMLParseError:
++ except (AssertionError, sgmllib.SGMLParseError):
+ # Escape the doctype declaration and continue parsing.
+ self.handle_data('&lt;')
+ return i+1