Patchwork keepalive: drop check for unsupported version of Python

login
register
mail settings
Submitter Bryan O'Sullivan
Date Nov. 29, 2016, 4:38 p.m.
Message ID <540fa940cd226021726c.1480437534@timothycui-mbp.local.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/17795/
State Accepted
Headers show

Comments

Bryan O'Sullivan - Nov. 29, 2016, 4:38 p.m.
# HG changeset patch
# User Bryan O'Sullivan <bryano@fb.com>
# Date 1480437473 28800
#      Tue Nov 29 08:37:53 2016 -0800
# Node ID 540fa940cd226021726c27475d4754cbf70246e4
# Parent  6a8aff737a17ada068b8ce4501184eacc66e827f
keepalive: drop check for unsupported version of Python
Jun Wu - Nov. 29, 2016, 4:50 p.m.
Marked as Pre-reviewed. Thanks for the cleaning up!

Excerpts from Bryan O'Sullivan's message of 2016-11-29 08:38:54 -0800:
> # HG changeset patch
> # User Bryan O'Sullivan <bryano@fb.com>
> # Date 1480437473 28800
> #      Tue Nov 29 08:37:53 2016 -0800
> # Node ID 540fa940cd226021726c27475d4754cbf70246e4
> # Parent  6a8aff737a17ada068b8ce4501184eacc66e827f
> keepalive: drop check for unsupported version of Python
> 
> diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
> --- a/mercurial/keepalive.py
> +++ b/mercurial/keepalive.py
> @@ -333,8 +333,7 @@ class KeepAliveHandler(object):
>          # What follows mostly reimplements HTTPConnection.request()
>          # except it adds self.parent.addheaders in the mix.
>          headers = req.headers.copy()
> -        if sys.version_info >= (2, 4):
> -            headers.update(req.unredirected_hdrs)
> +        headers.update(req.unredirected_hdrs)
>          headers.update(self.parent.addheaders)
>          headers = dict((n.lower(), v) for n, v in headers.items())
>          skipheaders = {}
Augie Fackler - Nov. 29, 2016, 5:45 p.m.
On Tue, Nov 29, 2016 at 04:50:10PM +0000, Jun Wu wrote:
> Marked as Pre-reviewed. Thanks for the cleaning up!

indygreg already got to this conditional in bc0def54c17d, so this
rebased away to nothing when I queued it. Thanks though!

>
> Excerpts from Bryan O'Sullivan's message of 2016-11-29 08:38:54 -0800:
> > # HG changeset patch
> > # User Bryan O'Sullivan <bryano@fb.com>
> > # Date 1480437473 28800
> > #      Tue Nov 29 08:37:53 2016 -0800
> > # Node ID 540fa940cd226021726c27475d4754cbf70246e4
> > # Parent  6a8aff737a17ada068b8ce4501184eacc66e827f
> > keepalive: drop check for unsupported version of Python
> >
> > diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
> > --- a/mercurial/keepalive.py
> > +++ b/mercurial/keepalive.py
> > @@ -333,8 +333,7 @@ class KeepAliveHandler(object):
> >          # What follows mostly reimplements HTTPConnection.request()
> >          # except it adds self.parent.addheaders in the mix.
> >          headers = req.headers.copy()
> > -        if sys.version_info >= (2, 4):
> > -            headers.update(req.unredirected_hdrs)
> > +        headers.update(req.unredirected_hdrs)
> >          headers.update(self.parent.addheaders)
> >          headers = dict((n.lower(), v) for n, v in headers.items())
> >          skipheaders = {}
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
--- a/mercurial/keepalive.py
+++ b/mercurial/keepalive.py
@@ -333,8 +333,7 @@  class KeepAliveHandler(object):
         # What follows mostly reimplements HTTPConnection.request()
         # except it adds self.parent.addheaders in the mix.
         headers = req.headers.copy()
-        if sys.version_info >= (2, 4):
-            headers.update(req.unredirected_hdrs)
+        headers.update(req.unredirected_hdrs)
         headers.update(self.parent.addheaders)
         headers = dict((n.lower(), v) for n, v in headers.items())
         skipheaders = {}