Mercurial > hg
diff mercurial/util.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 | df56e6bd37f6 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/mercurial/util.py Sun Feb 20 14:52:40 2022 -0700 +++ b/mercurial/util.py Sun Feb 20 15:03:26 2022 -0700 @@ -21,6 +21,7 @@ import errno import gc import hashlib +import io import itertools import locale import mmap @@ -78,7 +79,7 @@ httplib = pycompat.httplib safehasattr = pycompat.safehasattr socketserver = pycompat.socketserver -bytesio = pycompat.bytesio +bytesio = io.BytesIO # TODO deprecate stringio name, as it is a lie on Python 3. stringio = bytesio xmlrpclib = pycompat.xmlrpclib