mercurial/windows.py
changeset 45148 a37f290a7124
parent 45145 aea246bc04bd
child 45157 74b486226480
--- a/mercurial/windows.py	Fri Jul 17 00:37:33 2020 +0200
+++ b/mercurial/windows.py	Fri Jul 17 03:28:52 2020 +0200
@@ -197,6 +197,7 @@
 
     def __init__(self, fp):
         self.fp = fp
+        self.throttle = not pycompat.ispy3 and fp.isatty()
 
     def __getattr__(self, key):
         return getattr(self.fp, key)
@@ -208,13 +209,16 @@
             pass
 
     def write(self, s):
+        if not pycompat.ispy3:
+            self.softspace = 0
         try:
+            if not self.throttle:
+                return self.fp.write(s)
             # This is workaround for "Not enough space" error on
             # writing large size of data to console.
             limit = 16000
             l = len(s)
             start = 0
-            self.softspace = 0
             while start < l:
                 end = start + limit
                 self.fp.write(s[start:end])