changeset 31411:a53f2d4c734f

httpclient: don't use mutable default argument value Caught by pylint.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 14 Mar 2017 23:49:25 -0700
parents 86dfd31c0329
children ecc87acb4d10
files mercurial/httpclient/__init__.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/httpclient/__init__.py	Tue Mar 14 23:49:10 2017 -0700
+++ b/mercurial/httpclient/__init__.py	Tue Mar 14 23:49:25 2017 -0700
@@ -631,7 +631,7 @@
         self.close()
         self._connect(pheaders)
 
-    def request(self, method, path, body=None, headers={},
+    def request(self, method, path, body=None, headers=None,
                 expect_continue=False):
         """Send a request to the server.
 
@@ -642,6 +642,8 @@
         available. Use the `getresponse()` method to retrieve the
         response.
         """
+        if headers is None:
+            headers = {}
         method = _ensurebytes(method)
         path = _ensurebytes(path)
         if self.busy():