mercurial/dispatch.py
changeset 36636 c263c684da91
parent 36503 8b662717c53f
child 36637 e8c361316803
--- a/mercurial/dispatch.py	Thu Mar 01 18:25:19 2018 -0500
+++ b/mercurial/dispatch.py	Fri Mar 02 22:10:36 2018 -0500
@@ -105,12 +105,15 @@
         # change the status code and move on.
         except IOError:
             status = -1
-
     sys.exit(status & 255)
 
-def _initstdio():
-    for fp in (sys.stdin, sys.stdout, sys.stderr):
-        util.setbinary(fp)
+if pycompat.ispy3:
+    def _initstdio():
+        pass
+else:
+    def _initstdio():
+        for fp in (sys.stdin, sys.stdout, sys.stderr):
+            util.setbinary(fp)
 
 def _getsimilar(symbols, value):
     sim = lambda x: difflib.SequenceMatcher(None, value, x).ratio()