diff hgext/phabricator.py @ 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 5ced12cfa41b
children 6000f5b25c9b
line wrap: on
line diff
--- a/hgext/phabricator.py	Sun Feb 20 14:52:40 2022 -0700
+++ b/hgext/phabricator.py	Sun Feb 20 15:03:26 2022 -0700
@@ -62,6 +62,7 @@
 import base64
 import contextlib
 import hashlib
+import io
 import itertools
 import json
 import mimetypes
@@ -2200,7 +2201,7 @@
             for drev, contents in patches:
                 ui.status(_(b'applying patch from D%s\n') % drev)
 
-                with patch.extract(ui, pycompat.bytesio(contents)) as patchdata:
+                with patch.extract(ui, io.BytesIO(contents)) as patchdata:
                     msg, node, rej = cmdutil.tryimportone(
                         ui,
                         repo,