Mercurial > hg
changeset 26347:e9a35411bbbc
httpconnection: remove a mutable default argument
Mutable default arguments are know to the state of California to cause bugs.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 24 Sep 2015 00:54:30 -0700 |
parents | 2449a0a6ebda |
children | b80b2ee71a08 |
files | mercurial/httpconnection.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/httpconnection.py Thu Sep 24 00:52:21 2015 -0700 +++ b/mercurial/httpconnection.py Thu Sep 24 00:54:30 2015 -0700 @@ -107,7 +107,9 @@ class HTTPConnection(httpclient.HTTPConnection): response_class = HTTPResponse - def request(self, method, uri, body=None, headers={}): + def request(self, method, uri, body=None, headers=None): + if headers is None: + headers = {} if isinstance(body, httpsendfile): body.seek(0) httpclient.HTTPConnection.request(self, method, uri, body=body,