Mercurial > public > mercurial-scm > hg
comparison mercurial/profiling.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 | 18c8c18993f0 |
comparison
equal
deleted
inserted
replaced
48945:55d132525155 | 48946:642e31cb55f0 |
---|---|
171 kwargs['showtime'] = showtime | 171 kwargs['showtime'] = showtime |
172 | 172 |
173 statprof.display(fp, data=data, format=displayformat, **kwargs) | 173 statprof.display(fp, data=data, format=displayformat, **kwargs) |
174 | 174 |
175 | 175 |
176 class profile(object): | 176 class profile: |
177 """Start profiling. | 177 """Start profiling. |
178 | 178 |
179 Profiling is active when the context manager is active. When the context | 179 Profiling is active when the context manager is active. When the context |
180 manager exits, profiling results will be written to the configured output. | 180 manager exits, profiling results will be written to the configured output. |
181 """ | 181 """ |
229 elif self._output: | 229 elif self._output: |
230 path = util.expandpath(self._output) | 230 path = util.expandpath(self._output) |
231 self._fp = open(path, b'wb') | 231 self._fp = open(path, b'wb') |
232 elif pycompat.iswindows: | 232 elif pycompat.iswindows: |
233 # parse escape sequence by win32print() | 233 # parse escape sequence by win32print() |
234 class uifp(object): | 234 class uifp: |
235 def __init__(self, ui): | 235 def __init__(self, ui): |
236 self._ui = ui | 236 self._ui = ui |
237 | 237 |
238 def write(self, data): | 238 def write(self, data): |
239 self._ui.write_err(data) | 239 self._ui.write_err(data) |