summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-05-27 17:00:37 +0200
committerMichał Górny <mgorny@gentoo.org>2020-05-27 17:22:12 +0200
commitb8ac8ee8c30d7400592f56c9ae6c34c4b076fc02 (patch)
tree07e6046f5c7060e1c029598b031a7d170f0fdc32 /dev-python/twisted
parentdev-python/constantly: Port to py39 (diff)
downloadgentoo-b8ac8ee8c30d7400592f56c9ae6c34c4b076fc02.tar.gz
gentoo-b8ac8ee8c30d7400592f56c9ae6c34c4b076fc02.tar.bz2
gentoo-b8ac8ee8c30d7400592f56c9ae6c34c4b076fc02.zip
dev-python/twisted: Unbreak py2.7 in 19.10.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/twisted')
-rw-r--r--dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch41
-rw-r--r--dev-python/twisted/twisted-19.10.0.ebuild2
2 files changed, 42 insertions, 1 deletions
diff --git a/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch b/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch
new file mode 100644
index 000000000000..5fc4768e5d23
--- /dev/null
+++ b/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch
@@ -0,0 +1,41 @@
+diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py
+index 6001d1e40..1cf9172ef 100644
+--- a/src/twisted/web/test/test_http.py
++++ b/src/twisted/web/test/test_http.py
+@@ -9,15 +9,15 @@ from __future__ import absolute_import, division
+
+ import base64
+ import calendar
+-import cgi
+ import random
+
+ import hamcrest
+
+ try:
+ from urlparse import urlparse, urlunsplit, clear_cache
++ from cgi import parse_qs
+ except ImportError:
+- from urllib.parse import urlparse, urlunsplit, clear_cache
++ from urllib.parse import urlparse, urlunsplit, clear_cache, parse_qs
+
+ from io import BytesIO
+ from itertools import cycle
+@@ -2156,15 +2156,15 @@ Hello,
+ class QueryArgumentsTests(unittest.TestCase):
+ def testParseqs(self):
+ self.assertEqual(
+- cgi.parse_qs(b"a=b&d=c;+=f"),
++ parse_qs(b"a=b&d=c;+=f"),
+ http.parse_qs(b"a=b&d=c;+=f"))
+ self.assertRaises(
+ ValueError, http.parse_qs, b"blah", strict_parsing=True)
+ self.assertEqual(
+- cgi.parse_qs(b"a=&b=c", keep_blank_values=1),
++ parse_qs(b"a=&b=c", keep_blank_values=1),
+ http.parse_qs(b"a=&b=c", keep_blank_values=1))
+ self.assertEqual(
+- cgi.parse_qs(b"a=&b=c"),
++ parse_qs(b"a=&b=c"),
+ http.parse_qs(b"a=&b=c"))
+
+
diff --git a/dev-python/twisted/twisted-19.10.0.ebuild b/dev-python/twisted/twisted-19.10.0.ebuild
index 6f7b8e4d9c7e..6ed6b63c9d35 100644
--- a/dev-python/twisted/twisted-19.10.0.ebuild
+++ b/dev-python/twisted/twisted-19.10.0.ebuild
@@ -83,7 +83,7 @@ DEPEND="
python_prepare_all() {
local PATCHES=(
"${FILESDIR}"/${P}-py38.patch
- "${FILESDIR}"/twisted-20.3.0-py38-cgi.patch
+ "${FILESDIR}"/twisted-19.10.0-py38-cgi.patch
"${FILESDIR}"/twisted-20.3.0-py38-hmac.patch
)