Mercurial > hg
diff tests/test-template-map.t @ 45055:4c1b4805db57
pycompat: change users of pycompat.{stdin,stdout,stderr} to use procutil.std*
On Python 3, pycompat.{stdin,stdout,stderr} are usually block-buffered even if
connected to a TTY. procutil.{stdin,stdout,stderr} provide consistent behavior
across platforms and Python versions.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Mon, 06 Jul 2020 17:44:25 +0200 |
parents | 829088e87032 |
children | db0be4678399 |
line wrap: on
line diff
--- a/tests/test-template-map.t Mon Jul 06 10:30:55 2020 +0200 +++ b/tests/test-template-map.t Mon Jul 06 17:44:25 2020 +0200 @@ -675,20 +675,20 @@ > from __future__ import absolute_import > from mercurial import ( > dispatch, - > pycompat, > ) > from mercurial.utils import ( > cborutil, + > procutil, > stringutil, > ) > dispatch.initstdio() - > data = pycompat.stdin.read() + > data = procutil.stdin.read() > # our CBOR decoder doesn't support parsing indefinite-length arrays, > # but the log output is indefinite stream by nature. > assert data[:1] == cborutil.BEGIN_INDEFINITE_ARRAY > assert data[-1:] == cborutil.BREAK > items = cborutil.decodeall(data[1:-1]) - > pycompat.stdout.write(stringutil.pprint(items, indent=1) + b'\n') + > procutil.stdout.write(stringutil.pprint(items, indent=1) + b'\n') > EOF $ hg log -k nosuch -Tcbor | "$PYTHON" "$TESTTMP/decodecborarray.py"