Mercurial > hg
comparison mercurial/keepalive.py @ 45942:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | 49f8ba4febec |
children | 59fa3890d40a |
comparison
equal
deleted
inserted
replaced
45941:346af7687c6f | 45942:89a2afe31e82 |
---|---|
110 | 110 |
111 class ConnectionManager(object): | 111 class ConnectionManager(object): |
112 """ | 112 """ |
113 The connection manager must be able to: | 113 The connection manager must be able to: |
114 * keep track of all existing | 114 * keep track of all existing |
115 """ | 115 """ |
116 | 116 |
117 def __init__(self): | 117 def __init__(self): |
118 self._lock = threading.Lock() | 118 self._lock = threading.Lock() |
119 self._hostmap = collections.defaultdict(list) # host -> [connection] | 119 self._hostmap = collections.defaultdict(list) # host -> [connection] |
120 self._connmap = {} # map connections to host | 120 self._connmap = {} # map connections to host |
673 if reraise: | 673 if reraise: |
674 raise | 674 raise |
675 | 675 |
676 | 676 |
677 def wrapgetresponse(cls): | 677 def wrapgetresponse(cls): |
678 """Wraps getresponse in cls with a broken-pipe sane version. | 678 """Wraps getresponse in cls with a broken-pipe sane version.""" |
679 """ | |
680 | 679 |
681 def safegetresponse(self): | 680 def safegetresponse(self): |
682 # In safesend() we might set the _broken_pipe_resp | 681 # In safesend() we might set the _broken_pipe_resp |
683 # attribute, in which case the socket has already | 682 # attribute, in which case the socket has already |
684 # been closed and we just need to give them the response | 683 # been closed and we just need to give them the response |