comparison 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
comparison
equal deleted inserted replaced
14514:175e4b9d8a96 14515:76f295eaed86
1589 def removeauth(u): 1589 def removeauth(u):
1590 '''remove all authentication information from a url string''' 1590 '''remove all authentication information from a url string'''
1591 u = url(u) 1591 u = url(u)
1592 u.user = u.passwd = None 1592 u.user = u.passwd = None
1593 return str(u) 1593 return str(u)
1594
1595 def isatty(fd):
1596 try:
1597 return fd.isatty()
1598 except AttributeError:
1599 return False