mercurial/ui.py
changeset 8175 c8cb471fc9c2
parent 8144 fca54469480e
child 8182 b97abc7c1135
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)