diff mercurial/utils/procutil.py @ 39840:a9f56e4501c1

merge with stable
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 26 Sep 2018 08:46:56 -0700
parents f1d6021453c2 e5724be689b3
children 3fbfbc8c9f82
line wrap: on
line diff
--- a/mercurial/utils/procutil.py	Tue Sep 25 08:53:20 2018 -0700
+++ b/mercurial/utils/procutil.py	Wed Sep 26 08:46:56 2018 -0700
@@ -278,13 +278,13 @@
     """
     uout.flush()
     fin, fout = uin, uout
-    if uin is stdin:
+    if _testfileno(uin, stdin):
         newfd = os.dup(uin.fileno())
         nullfd = os.open(os.devnull, os.O_RDONLY)
         os.dup2(nullfd, uin.fileno())
         os.close(nullfd)
         fin = os.fdopen(newfd, r'rb')
-    if uout is stdout:
+    if _testfileno(uout, stdout):
         newfd = os.dup(uout.fileno())
         os.dup2(stderr.fileno(), uout.fileno())
         fout = os.fdopen(newfd, r'wb')