Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
Date: Wed, 27 May 2020 15:22:21
Message-Id: 1590592932.b8ac8ee8c30d7400592f56c9ae6c34c4b076fc02.mgorny@gentoo
1 commit: b8ac8ee8c30d7400592f56c9ae6c34c4b076fc02
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 27 15:00:37 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed May 27 15:22:12 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8ac8ee8
7
8 dev-python/twisted: Unbreak py2.7 in 19.10.0
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../twisted/files/twisted-19.10.0-py38-cgi.patch | 41 ++++++++++++++++++++++
13 dev-python/twisted/twisted-19.10.0.ebuild | 2 +-
14 2 files changed, 42 insertions(+), 1 deletion(-)
15
16 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
17 new file mode 100644
18 index 00000000000..5fc4768e5d2
19 --- /dev/null
20 +++ b/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch
21 @@ -0,0 +1,41 @@
22 +diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py
23 +index 6001d1e40..1cf9172ef 100644
24 +--- a/src/twisted/web/test/test_http.py
25 ++++ b/src/twisted/web/test/test_http.py
26 +@@ -9,15 +9,15 @@ from __future__ import absolute_import, division
27 +
28 + import base64
29 + import calendar
30 +-import cgi
31 + import random
32 +
33 + import hamcrest
34 +
35 + try:
36 + from urlparse import urlparse, urlunsplit, clear_cache
37 ++ from cgi import parse_qs
38 + except ImportError:
39 +- from urllib.parse import urlparse, urlunsplit, clear_cache
40 ++ from urllib.parse import urlparse, urlunsplit, clear_cache, parse_qs
41 +
42 + from io import BytesIO
43 + from itertools import cycle
44 +@@ -2156,15 +2156,15 @@ Hello,
45 + class QueryArgumentsTests(unittest.TestCase):
46 + def testParseqs(self):
47 + self.assertEqual(
48 +- cgi.parse_qs(b"a=b&d=c;+=f"),
49 ++ parse_qs(b"a=b&d=c;+=f"),
50 + http.parse_qs(b"a=b&d=c;+=f"))
51 + self.assertRaises(
52 + ValueError, http.parse_qs, b"blah", strict_parsing=True)
53 + self.assertEqual(
54 +- cgi.parse_qs(b"a=&b=c", keep_blank_values=1),
55 ++ parse_qs(b"a=&b=c", keep_blank_values=1),
56 + http.parse_qs(b"a=&b=c", keep_blank_values=1))
57 + self.assertEqual(
58 +- cgi.parse_qs(b"a=&b=c"),
59 ++ parse_qs(b"a=&b=c"),
60 + http.parse_qs(b"a=&b=c"))
61 +
62 +
63
64 diff --git a/dev-python/twisted/twisted-19.10.0.ebuild b/dev-python/twisted/twisted-19.10.0.ebuild
65 index 6f7b8e4d9c7..6ed6b63c9d3 100644
66 --- a/dev-python/twisted/twisted-19.10.0.ebuild
67 +++ b/dev-python/twisted/twisted-19.10.0.ebuild
68 @@ -83,7 +83,7 @@ DEPEND="
69 python_prepare_all() {
70 local PATCHES=(
71 "${FILESDIR}"/${P}-py38.patch
72 - "${FILESDIR}"/twisted-20.3.0-py38-cgi.patch
73 + "${FILESDIR}"/twisted-19.10.0-py38-cgi.patch
74 "${FILESDIR}"/twisted-20.3.0-py38-hmac.patch
75 )