Mercurial > hg
comparison tests/testlib/badserverext.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 | 6000f5b25c9b |
children | 425ca3428d03 |
comparison
equal
deleted
inserted
replaced
48945:55d132525155 | 48946:642e31cb55f0 |
---|---|
88 b'close-before-accept', | 88 b'close-before-accept', |
89 default=False, | 89 default=False, |
90 ) | 90 ) |
91 | 91 |
92 | 92 |
93 class ConditionTracker(object): | 93 class ConditionTracker: |
94 def __init__( | 94 def __init__( |
95 self, | 95 self, |
96 close_after_recv_bytes, | 96 close_after_recv_bytes, |
97 close_after_recv_patterns, | 97 close_after_recv_patterns, |
98 close_after_send_bytes, | 98 close_after_send_bytes, |
254 | 254 |
255 return result | 255 return result |
256 | 256 |
257 | 257 |
258 # We can't adjust __class__ on a socket instance. So we define a proxy type. | 258 # We can't adjust __class__ on a socket instance. So we define a proxy type. |
259 class socketproxy(object): | 259 class socketproxy: |
260 __slots__ = ('_orig', '_logfp', '_cond') | 260 __slots__ = ('_orig', '_logfp', '_cond') |
261 | 261 |
262 def __init__(self, obj, logfp, condition_tracked): | 262 def __init__(self, obj, logfp, condition_tracked): |
263 object.__setattr__(self, '_orig', obj) | 263 object.__setattr__(self, '_orig', obj) |
264 object.__setattr__(self, '_logfp', logfp) | 264 object.__setattr__(self, '_logfp', logfp) |
298 def _cond_close(self): | 298 def _cond_close(self): |
299 object.__getattribute__(self, '_orig').shutdown(socket.SHUT_RDWR) | 299 object.__getattribute__(self, '_orig').shutdown(socket.SHUT_RDWR) |
300 | 300 |
301 | 301 |
302 # We can't adjust __class__ on socket._fileobject, so define a proxy. | 302 # We can't adjust __class__ on socket._fileobject, so define a proxy. |
303 class fileobjectproxy(object): | 303 class fileobjectproxy: |
304 __slots__ = ('_orig', '_logfp', '_cond') | 304 __slots__ = ('_orig', '_logfp', '_cond') |
305 | 305 |
306 def __init__(self, obj, logfp, condition_tracked): | 306 def __init__(self, obj, logfp, condition_tracked): |
307 object.__setattr__(self, '_orig', obj) | 307 object.__setattr__(self, '_orig', obj) |
308 object.__setattr__(self, '_logfp', logfp) | 308 object.__setattr__(self, '_logfp', logfp) |