sshpeer: check pipe validity before forwarding output from it
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 10 Mar 2018 12:45:10 -0500
changeset 36833 46f4d71ed505
parent 36832 6bdea0efdab5
child 36834 1527f40de3b3
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.
mercurial/sshpeer.py
--- 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