comparison mercurial/ui.py @ 8175:c8cb471fc9c2

ui.isatty() accesses sys.stdin, causing mod_wsgi to throw IOError.
author Benjamin Wohlwend <bw@piquadrat.ch>
date Sun, 26 Apr 2009 13:36:08 -0700
parents fca54469480e
children b97abc7c1135
comparison
equal deleted inserted replaced
8174:29bc5d18714a 8175:c8cb471fc9c2
47 def isatty(self): 47 def isatty(self):
48 if ui._isatty is None: 48 if ui._isatty is None:
49 try: 49 try:
50 ui._isatty = sys.stdin.isatty() 50 ui._isatty = sys.stdin.isatty()
51 except AttributeError: # not a real file object 51 except AttributeError: # not a real file object
52 ui._isatty = False
53 except IOError:
54 # access to stdin is unsafe in a WSGI environment
52 ui._isatty = False 55 ui._isatty = False
53 return ui._isatty 56 return ui._isatty
54 57
55 def _is_trusted(self, fp, f): 58 def _is_trusted(self, fp, f):
56 st = util.fstat(fp) 59 st = util.fstat(fp)