changeset 36833:46f4d71ed505

sshpeer: check pipe validity before forwarding output from it After the previous fix, fileobjectproxy._observedcall() (called when win32.peekpipe() accesses .fileno) started exploding. With this fix, similar checks are needed inside debugwireproto(). Since that is hardcoded to not use os.devnull, IDK if those are worth fixing.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 10 Mar 2018 12:45:10 -0500
parents 6bdea0efdab5
children 1527f40de3b3
files mercurial/sshpeer.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/sshpeer.py	Sat Mar 10 12:22:08 2018 -0500
+++ b/mercurial/sshpeer.py	Sat Mar 10 12:45:10 2018 -0500
@@ -32,10 +32,11 @@
     """display all data currently available on pipe as remote output.
 
     This is non blocking."""
-    s = util.readpipe(pipe)
-    if s:
-        for l in s.splitlines():
-            ui.status(_("remote: "), l, '\n')
+    if pipe:
+        s = util.readpipe(pipe)
+        if s:
+            for l in s.splitlines():
+                ui.status(_("remote: "), l, '\n')
 
 class doublepipe(object):
     """Operate a side-channel pipe in addition of a main one