##// 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 listdir = osutil.listdir
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 class winstdout(object):
197 class winstdout(object):
190 '''Some files on Windows misbehave.
198 '''Some files on Windows misbehave.
191
199
@@ -197,7 +205,7 b' class winstdout(object):'
197
205
198 def __init__(self, fp):
206 def __init__(self, fp):
199 self.fp = fp
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 def __getattr__(self, key):
210 def __getattr__(self, key):
203 return getattr(self.fp, key)
211 return getattr(self.fp, key)
General Comments 0
You need to be logged in to leave comments. Login now