Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 27363:c7ab2087d436
util: rename argument of isatty()
In general, "fd" is a file descriptor, but isatty() expects a file object.
We should call it "fp" or "fh".
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 13 Dec 2015 18:48:35 +0900 |
parents | ac839ee45b6a |
children | 45d996a566d7 |
comparison
equal
deleted
inserted
replaced
27362:c220434a3461 | 27363:c7ab2087d436 |
---|---|
2306 '''remove all authentication information from a url string''' | 2306 '''remove all authentication information from a url string''' |
2307 u = url(u) | 2307 u = url(u) |
2308 u.user = u.passwd = None | 2308 u.user = u.passwd = None |
2309 return str(u) | 2309 return str(u) |
2310 | 2310 |
2311 def isatty(fd): | 2311 def isatty(fp): |
2312 try: | 2312 try: |
2313 return fd.isatty() | 2313 return fp.isatty() |
2314 except AttributeError: | 2314 except AttributeError: |
2315 return False | 2315 return False |
2316 | 2316 |
2317 timecount = unitcountfn( | 2317 timecount = unitcountfn( |
2318 (1, 1e3, _('%.0f s')), | 2318 (1, 1e3, _('%.0f s')), |