Mercurial > hg
comparison mercurial/keepalive.py @ 48946:642e31cb55f0
py3: use class X: instead of class X(object):
The inheritance from object is implied in Python 3. So this should
be equivalent.
This change was generated via an automated search and replace. So there
may have been some accidental changes.
Differential Revision: https://phab.mercurial-scm.org/D12352
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 13:08:28 -0700 |
parents | dea766fca7e1 |
children | 48f1b314056b |
comparison
equal
deleted
inserted
replaced
48945:55d132525155 | 48946:642e31cb55f0 |
---|---|
105 urlreq = util.urlreq | 105 urlreq = util.urlreq |
106 | 106 |
107 DEBUG = None | 107 DEBUG = None |
108 | 108 |
109 | 109 |
110 class ConnectionManager(object): | 110 class ConnectionManager: |
111 """ | 111 """ |
112 The connection manager must be able to: | 112 The connection manager must be able to: |
113 * keep track of all existing | 113 * keep track of all existing |
114 """ | 114 """ |
115 | 115 |
168 return list(self._hostmap[host]) | 168 return list(self._hostmap[host]) |
169 else: | 169 else: |
170 return dict(self._hostmap) | 170 return dict(self._hostmap) |
171 | 171 |
172 | 172 |
173 class KeepAliveHandler(object): | 173 class KeepAliveHandler: |
174 def __init__(self, timeout=None): | 174 def __init__(self, timeout=None): |
175 self._cm = ConnectionManager() | 175 self._cm = ConnectionManager() |
176 self._timeout = timeout | 176 self._timeout = timeout |
177 self.requestscount = 0 | 177 self.requestscount = 0 |
178 self.sentbytescount = 0 | 178 self.sentbytescount = 0 |
787 | 787 |
788 def test_timeout(url): | 788 def test_timeout(url): |
789 global DEBUG | 789 global DEBUG |
790 dbbackup = DEBUG | 790 dbbackup = DEBUG |
791 | 791 |
792 class FakeLogger(object): | 792 class FakeLogger: |
793 def debug(self, msg, *args): | 793 def debug(self, msg, *args): |
794 print(msg % args) | 794 print(msg % args) |
795 | 795 |
796 info = warning = error = debug | 796 info = warning = error = debug |
797 | 797 |