comparison mercurial/httpclient/__init__.py @ 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 456609cbd840
children
comparison
equal deleted inserted replaced
31410:86dfd31c0329 31411:a53f2d4c734f
629 def _reconnect(self, where, pheaders): 629 def _reconnect(self, where, pheaders):
630 logger.info('reconnecting during %s', where) 630 logger.info('reconnecting during %s', where)
631 self.close() 631 self.close()
632 self._connect(pheaders) 632 self._connect(pheaders)
633 633
634 def request(self, method, path, body=None, headers={}, 634 def request(self, method, path, body=None, headers=None,
635 expect_continue=False): 635 expect_continue=False):
636 """Send a request to the server. 636 """Send a request to the server.
637 637
638 For increased flexibility, this does not return the response 638 For increased flexibility, this does not return the response
639 object. Future versions of HTTPConnection that juggle multiple 639 object. Future versions of HTTPConnection that juggle multiple
640 sockets will be able to send (for example) 5 requests all at 640 sockets will be able to send (for example) 5 requests all at
641 once, and then let the requests arrive as data is 641 once, and then let the requests arrive as data is
642 available. Use the `getresponse()` method to retrieve the 642 available. Use the `getresponse()` method to retrieve the
643 response. 643 response.
644 """ 644 """
645 if headers is None:
646 headers = {}
645 method = _ensurebytes(method) 647 method = _ensurebytes(method)
646 path = _ensurebytes(path) 648 path = _ensurebytes(path)
647 if self.busy(): 649 if self.busy():
648 raise httplib.CannotSendRequest( 650 raise httplib.CannotSendRequest(
649 'Can not send another request before ' 651 'Can not send another request before '