##// END OF EJS Templates
windows: handle file-like objects without isatty() method...
Manuel Jacob -
r45717:74b48622 default
parent child Browse files
Show More
@@ -186,6 +186,14 b" def posixfile(name, mode=b'r', buffering"
186 186 listdir = osutil.listdir
187 187
188 188
189 # copied from .utils.procutil, remove after Python 2 support was dropped
190 def _isatty(fp):
191 try:
192 return fp.isatty()
193 except AttributeError:
194 return False
195
196
189 197 class winstdout(object):
190 198 '''Some files on Windows misbehave.
191 199
@@ -197,7 +205,7 b' class winstdout(object):'
197 205
198 206 def __init__(self, fp):
199 207 self.fp = fp
200 self.throttle = not pycompat.ispy3 and fp.isatty()
208 self.throttle = not pycompat.ispy3 and _isatty(fp)
201 209
202 210 def __getattr__(self, key):
203 211 return getattr(self.fp, key)
General Comments 0
You need to be logged in to leave comments. Login now