--- /dev/null
+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"))
+
+