diff tests/test-basic.t @ 48873:5aafc3c5bdec

py3: use io.BytesIO directly Previously, pycompat.bytesio and pycompat.stringio referred to io.BytesIO. And util.bytesio and util.stringio aliased the pycompat symbols. This commit switches everything to use io.BytesIO directly. util.bytesio and util.stringio still exist to provide backwards compatibility, as they were the preferred symbols. Differential Revision: https://phab.mercurial-scm.org/D12252
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 20 Feb 2022 15:03:26 -0700
parents e845537f6adb
children c84844cd523a
line wrap: on
line diff
--- a/tests/test-basic.t	Sun Feb 20 14:52:40 2022 -0700
+++ b/tests/test-basic.t	Sun Feb 20 15:03:26 2022 -0700
@@ -240,15 +240,16 @@
 Underlying message streams should be updated when ui.fout/ferr are set:
 
   $ cat <<'EOF' > capui.py
-  > from mercurial import pycompat, registrar
+  > import io
+  > from mercurial import registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
   > @command(b'capui', norepo=True)
   > def capui(ui):
   >     out = ui.fout
-  >     ui.fout = pycompat.bytesio()
+  >     ui.fout = io.BytesIO()
   >     ui.status(b'status\n')
-  >     ui.ferr = pycompat.bytesio()
+  >     ui.ferr = io.BytesIO()
   >     ui.warn(b'warn\n')
   >     out.write(b'stdout: %s' % ui.fout.getvalue())
   >     out.write(b'stderr: %s' % ui.ferr.getvalue())