Mercurial > hg-stable
changeset 12654:646eb9337c87
progress: make sure stderr has isatty before calling (issue2191)
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Sat, 09 Oct 2010 09:55:52 -0500 |
parents | 5096faaa280e |
children | 5192b24f309c |
files | hgext/progress.py |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/progress.py Sat Oct 09 18:04:36 2010 +0200 +++ b/hgext/progress.py Sat Oct 09 09:55:52 2010 -0500 @@ -51,7 +51,8 @@ return ' '.join(s for s in args if s) def shouldprint(ui): - return sys.stderr.isatty() or ui.configbool('progress', 'assume-tty') + return (getattr(sys.stderr, 'isatty', None) and + (sys.stderr.isatty() or ui.configbool('progress', 'assume-tty'))) class progbar(object): def __init__(self, ui):