diff mercurial/sshpeer.py @ 36841: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 70415568ea65
children a8a902d7176e
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