diff mercurial/util.py @ 14515:76f295eaed86

util: add helper function isatty(fd) to check for tty-ness
author Idan Kamara <idankk86@gmail.com>
date Thu, 02 Jun 2011 00:43:34 +0300
parents a389dd285282
children 406b6d7bdcb9
line wrap: on
line diff
--- a/mercurial/util.py	Thu Jun 02 18:52:31 2011 +0800
+++ b/mercurial/util.py	Thu Jun 02 00:43:34 2011 +0300
@@ -1591,3 +1591,9 @@
     u = url(u)
     u.user = u.passwd = None
     return str(u)
+
+def isatty(fd):
+    try:
+        return fd.isatty()
+    except AttributeError:
+        return False