diff --git a/mercurial/statprof.py b/mercurial/statprof.py --- a/mercurial/statprof.py +++ b/mercurial/statprof.py @@ -494,9 +494,9 @@ def display(fp=None, format=3, data=None data = state if fp is None: - import sys + from .utils import procutil - fp = sys.stdout + fp = procutil.stdout if len(data.samples) == 0: fp.write(b'No samples recorded.\n') return diff --git a/tests/test-check-pytype.t b/tests/test-check-pytype.t --- a/tests/test-check-pytype.t +++ b/tests/test-check-pytype.t @@ -32,7 +32,6 @@ mercurial/pure/parsers.py # [attribu mercurial/pycompat.py # bytes vs str issues mercurial/repoview.py # [attribute-error] mercurial/sslutil.py # [attribute-error] -mercurial/statprof.py # bytes vs str on TextIO.write() [wrong-arg-types] mercurial/testing/storage.py # tons of [attribute-error] mercurial/ui.py # [attribute-error], [wrong-arg-types] mercurial/unionrepo.py # ui, svfs, unfiltered [attribute-error] @@ -72,7 +71,6 @@ development, but may be a hinderance for > -x mercurial/pycompat.py \ > -x mercurial/repoview.py \ > -x mercurial/sslutil.py \ - > -x mercurial/statprof.py \ > -x mercurial/testing/storage.py \ > -x mercurial/thirdparty \ > -x mercurial/ui.py \