# HG changeset patch # User Pierre-Yves David # Date 2015-09-24 07:54:30 # Node ID e9a35411bbbcf7c09ab002fca424ce982d8b3dc5 # Parent 2449a0a6ebda323da36f260bc52b3636b131cbea httpconnection: remove a mutable default argument Mutable default arguments are know to the state of California to cause bugs. diff --git a/mercurial/httpconnection.py b/mercurial/httpconnection.py --- a/mercurial/httpconnection.py +++ b/mercurial/httpconnection.py @@ -107,7 +107,9 @@ class HTTPResponse(httpclient.HTTPRespon 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,