Patchwork util: rename argument of isatty()

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 13, 2015, 2:50 p.m.
Message ID <21c726c0b045b7f4b871.1450018232@mimosa>
Download mbox | patch
Permalink /patch/12014/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 13, 2015, 2:50 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1450000115 -32400
#      Sun Dec 13 18:48:35 2015 +0900
# Node ID 21c726c0b045b7f4b871446e6445a2a586fd3992
# Parent  d43f8d4b12a79e66b1350c3669f599a9a45b2ee8
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".
Augie Fackler - Dec. 15, 2015, 6:15 p.m.
On Sun, Dec 13, 2015 at 11:50:32PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1450000115 -32400
> #      Sun Dec 13 18:48:35 2015 +0900
> # Node ID 21c726c0b045b7f4b871446e6445a2a586fd3992
> # Parent  d43f8d4b12a79e66b1350c3669f599a9a45b2ee8
> util: rename argument of isatty()

Sensible. Queued.

>
> In general, "fd" is a file descriptor, but isatty() expects a file object.
> We should call it "fp" or "fh".
>
> diff --git a/mercurial/util.py b/mercurial/util.py
> --- a/mercurial/util.py
> +++ b/mercurial/util.py
> @@ -2293,9 +2293,9 @@ def removeauth(u):
>      u.user = u.passwd = None
>      return str(u)
>
> -def isatty(fd):
> +def isatty(fp):
>      try:
> -        return fd.isatty()
> +        return fp.isatty()
>      except AttributeError:
>          return False
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -2293,9 +2293,9 @@  def removeauth(u):
     u.user = u.passwd = None
     return str(u)
 
-def isatty(fd):
+def isatty(fp):
     try:
-        return fd.isatty()
+        return fp.isatty()
     except AttributeError:
         return False