changeset 41431:1db94ebbc207

keepalive: track ready state with a bool This code may have been written before Python had a bool type. Differential Revision: https://phab.mercurial-scm.org/D5719
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 26 Jan 2019 13:40:44 -0800
parents a43acfa2b76d
children 0d226b2139df
files mercurial/keepalive.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/keepalive.py	Sat Jan 26 13:39:18 2019 -0800
+++ b/mercurial/keepalive.py	Sat Jan 26 13:40:44 2019 -0800
@@ -156,7 +156,7 @@
         try:
             for c in self._hostmap[host]:
                 if self._readymap[c]:
-                    self._readymap[c] = 0
+                    self._readymap[c] = False
                     conn = c
                     break
         finally:
@@ -200,7 +200,7 @@
     def _request_closed(self, request, host, connection):
         """tells us that this request is now closed and that the
         connection is ready for another request"""
-        self._cm.set_ready(connection, 1)
+        self._cm.set_ready(connection, True)
 
     def _remove_connection(self, host, connection, close=0):
         if close:
@@ -237,7 +237,7 @@
                 if DEBUG:
                     DEBUG.info("creating new connection to %s (%d)",
                                host, id(h))
-                self._cm.add(host, h, 0)
+                self._cm.add(host, h, False)
                 self._start_transaction(h, req)
                 r = h.getresponse()
         # The string form of BadStatusLine is the status line. Add some context