diff mercurial/wireprotoserver.py @ 36077:a3d42d1865f1

wireprotoserver: define and use parse_qs from urllib The cgi module is deprecated since Python 2.6. Let's replace uses of it in wireprotoserver with a similar function from urllib. Differential Revision: https://phab.mercurial-scm.org/D2094
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 06 Feb 2018 18:13:15 -0800
parents ac33dc94e1d5
children b67d4b7e8235
line wrap: on
line diff
--- a/mercurial/wireprotoserver.py	Wed Feb 07 17:18:27 2018 -0800
+++ b/mercurial/wireprotoserver.py	Tue Feb 06 18:13:15 2018 -0800
@@ -7,7 +7,6 @@
 from __future__ import absolute_import
 
 import abc
-import cgi
 import contextlib
 import struct
 import sys
@@ -134,12 +133,12 @@
         args = util.rapply(pycompat.bytesurl, self._req.form.copy())
         postlen = int(self._req.env.get(r'HTTP_X_HGARGS_POST', 0))
         if postlen:
-            args.update(cgi.parse_qs(
+            args.update(urlreq.parseqs(
                 self._req.read(postlen), keep_blank_values=True))
             return args
 
         argvalue = decodevaluefromheaders(self._req, r'X-HgArg')
-        args.update(cgi.parse_qs(argvalue, keep_blank_values=True))
+        args.update(urlreq.parseqs(argvalue, keep_blank_values=True))
         return args
 
     def forwardpayload(self, fp):