pycompat: add util.stringio to handle py3 divergence
util.stringio = cStringIO.StringIO / io.StringIO
--- a/mercurial/pycompat.py Wed Apr 06 22:35:52 2016 +0000
+++ b/mercurial/pycompat.py Wed Apr 06 20:31:31 2016 +0000
@@ -11,6 +11,13 @@
from __future__ import absolute_import
try:
+ import cStringIO as io
+ stringio = io.StringIO
+except ImportError:
+ import io
+ stringio = io.StringIO
+
+try:
import Queue as _queue
_queue.Queue
except ImportError:
--- a/mercurial/util.py Wed Apr 06 22:35:52 2016 +0000
+++ b/mercurial/util.py Wed Apr 06 20:31:31 2016 +0000
@@ -49,6 +49,7 @@
for attr in (
'empty',
'queue',
+ 'stringio',
):
globals()[attr] = getattr(pycompat, attr)