changeset 35373:03112a2c9c83

py3: handle keyword arguments correctly in keepalive.py Differential Revision: https://phab.mercurial-scm.org/D1637
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 10 Dec 2017 04:47:34 +0530
parents b0ba1539af01
children 7354fda50e8b
files mercurial/keepalive.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/keepalive.py	Fri Dec 08 00:18:30 2017 -0500
+++ b/mercurial/keepalive.py	Sun Dec 10 04:47:34 2017 +0530
@@ -322,7 +322,7 @@
                 data = urllibcompat.getdata(req)
                 h.putrequest(
                     req.get_method(), urllibcompat.getselector(req),
-                    **skipheaders)
+                    **pycompat.strkwargs(skipheaders))
                 if 'content-type' not in headers:
                     h.putheader('Content-type',
                                 'application/x-www-form-urlencoded')
@@ -331,7 +331,7 @@
             else:
                 h.putrequest(
                     req.get_method(), urllibcompat.getselector(req),
-                    **skipheaders)
+                    **pycompat.strkwargs(skipheaders))
         except socket.error as err:
             raise urlerr.urlerror(err)
         for k, v in headers.items():
@@ -366,8 +366,8 @@
     def __init__(self, sock, debuglevel=0, strict=0, method=None):
         extrakw = {}
         if not pycompat.ispy3:
-            extrakw['strict'] = True
-            extrakw['buffering'] = True
+            extrakw[r'strict'] = True
+            extrakw[r'buffering'] = True
         httplib.HTTPResponse.__init__(self, sock, debuglevel=debuglevel,
                                       method=method, **extrakw)
         self.fileno = sock.fileno