diff mercurial/httpconnection.py @ 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 d343806dcf68
children b1adf32b0605
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,