changeset 36797:d4c760c997cd

py3: drop encoding.strio() Its buffered nature makes TextIOWrapper unsuitable for temporarily wrapping bytes I/O.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 06 Mar 2018 02:43:17 -0600
parents aa0fc12743c7
children 7574c8173d5e
files mercurial/encoding.py
diffstat 1 files changed, 0 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/encoding.py	Tue Mar 06 02:42:37 2018 -0600
+++ b/mercurial/encoding.py	Tue Mar 06 02:43:17 2018 -0600
@@ -7,7 +7,6 @@
 
 from __future__ import absolute_import, print_function
 
-import io
 import locale
 import os
 import unicodedata
@@ -581,18 +580,3 @@
             c = pycompat.bytechr(ord(c.decode("utf-8", _utf8strict)) & 0xff)
         r += c
     return r
-
-if pycompat.ispy3:
-    class strio(io.TextIOWrapper):
-        """Wrapper around TextIOWrapper that respects hg's encoding assumptions.
-
-        Also works around Python closing streams.
-        """
-
-        def __init__(self, buffer):
-            super(strio, self).__init__(buffer, encoding=_sysstr(encoding))
-
-        def __del__(self):
-            """Override __del__ so it doesn't close the underlying stream."""
-else:
-    strio = pycompat.identity