# HG changeset patch # User Matt Harbison # Date 1520703910 18000 # Node ID 46f4d71ed5056a4cbd9197e1bb5f0c95e9b8d358 # Parent 6bdea0efdab5221e7e60b6cbd4b209ed3526d14f 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. diff -r 6bdea0efdab5 -r 46f4d71ed505 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