Mercurial > public > mercurial-scm > hg
comparison mercurial/utils/procutil.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 | f254fc73d956 |
children | ea98850a136e |
comparison
equal
deleted
inserted
replaced
48945:55d132525155 | 48946:642e31cb55f0 |
---|---|
57 | 57 |
58 def write(self, b): | 58 def write(self, b): |
59 raise IOError(errno.EBADF, 'Bad file descriptor') | 59 raise IOError(errno.EBADF, 'Bad file descriptor') |
60 | 60 |
61 | 61 |
62 class LineBufferedWrapper(object): | 62 class LineBufferedWrapper: |
63 def __init__(self, orig): | 63 def __init__(self, orig): |
64 self.orig = orig | 64 self.orig = orig |
65 | 65 |
66 def __getattr__(self, attr): | 66 def __getattr__(self, attr): |
67 return getattr(self.orig, attr) | 67 return getattr(self.orig, attr) |
96 assert not isinstance(stream.orig, LineBufferedWrapper) | 96 assert not isinstance(stream.orig, LineBufferedWrapper) |
97 return stream.orig | 97 return stream.orig |
98 return stream | 98 return stream |
99 | 99 |
100 | 100 |
101 class WriteAllWrapper(object): | 101 class WriteAllWrapper: |
102 def __init__(self, orig): | 102 def __init__(self, orig): |
103 self.orig = orig | 103 self.orig = orig |
104 | 104 |
105 def __getattr__(self, attr): | 105 def __getattr__(self, attr): |
106 return getattr(self.orig, attr) | 106 return getattr(self.orig, attr) |
191 if code >= 0: | 191 if code >= 0: |
192 return _(b"exited with status %d") % code | 192 return _(b"exited with status %d") % code |
193 return _(b"killed by signal %d") % -code | 193 return _(b"killed by signal %d") % -code |
194 | 194 |
195 | 195 |
196 class _pfile(object): | 196 class _pfile: |
197 """File-like wrapper for a stream opened by subprocess.Popen()""" | 197 """File-like wrapper for a stream opened by subprocess.Popen()""" |
198 | 198 |
199 def __init__(self, proc, fp): | 199 def __init__(self, proc, fp): |
200 self._proc = proc | 200 self._proc = proc |
201 self._fp = fp | 201 self._fp = fp |