Mercurial > public > mercurial-scm > hg
comparison mercurial/profiling.py @ 52363:6a8edf9f0a6d
profiling: stop using the `pycompat.open()` shim
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 04 Dec 2024 20:46:30 -0500 |
parents | 499b19683c1b |
children | 5ff6fba7c4c5 |
comparison
equal
deleted
inserted
replaced
52362:7ac8fdb70bae | 52363:6a8edf9f0a6d |
---|---|
12 import signal | 12 import signal |
13 import subprocess | 13 import subprocess |
14 import sys | 14 import sys |
15 | 15 |
16 from .i18n import _ | 16 from .i18n import _ |
17 from .pycompat import ( | |
18 open, | |
19 ) | |
20 from . import ( | 17 from . import ( |
21 encoding, | 18 encoding, |
22 error, | 19 error, |
23 extensions, | 20 extensions, |
24 pycompat, | 21 pycompat, |
296 try: | 293 try: |
297 if self._output == b'blackbox': | 294 if self._output == b'blackbox': |
298 self._fp = util.stringio() | 295 self._fp = util.stringio() |
299 elif self._output: | 296 elif self._output: |
300 path = util.expandpath(self._output) | 297 path = util.expandpath(self._output) |
301 self._fp = open(path, b'wb') | 298 self._fp = open(path, 'wb') |
302 elif pycompat.iswindows: | 299 elif pycompat.iswindows: |
303 # parse escape sequence by win32print() | 300 # parse escape sequence by win32print() |
304 class uifp: | 301 class uifp: |
305 def __init__(self, ui): | 302 def __init__(self, ui): |
306 self._ui = ui | 303 self._ui = ui |