hgext/progress.py
changeset 14515 76f295eaed86
parent 14280 98e4d3914c2e
child 14836 925cab23d7d5
--- a/hgext/progress.py	Thu Jun 02 18:52:31 2011 +0800
+++ b/hgext/progress.py	Thu Jun 02 00:43:34 2011 +0300
@@ -46,14 +46,14 @@
 import sys
 import time
 
+from mercurial import util
 from mercurial.i18n import _
 
 def spacejoin(*args):
     return ' '.join(s for s in args if s)
 
 def shouldprint(ui):
-    return (getattr(sys.stderr, 'isatty', None) and
-            (sys.stderr.isatty() or ui.configbool('progress', 'assume-tty')))
+    return (util.isatty(sys.stderr) or ui.configbool('progress', 'assume-tty'))
 
 def fmtremaining(seconds):
     if seconds < 60: