# HG changeset patch # User Valentin Gatien-Baron # Date 2021-02-15 19:11:38 # Node ID c9434fcbc901a3f0f11173d1be9a6a36837492ef # Parent 309e6729e435156bbaa49e18da12a38ce8fd3974 sshpeer: add a method to check if a doublepipe is closed So we can tell in a next commit if we're trying to close an already closed connection or not (in which case, we may warn). Differential Revision: https://phab.mercurial-scm.org/D9996 diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py --- a/mercurial/sshpeer.py +++ b/mercurial/sshpeer.py @@ -140,6 +140,10 @@ class doublepipe(object): def close(self): return self._main.close() + @property + def closed(self): + return self._main.closed + def flush(self): return self._main.flush() diff --git a/tests/test-check-interfaces.py b/tests/test-check-interfaces.py --- a/tests/test-check-interfaces.py +++ b/tests/test-check-interfaces.py @@ -113,6 +113,10 @@ class dummypipe(object): def close(self): pass + @property + def closed(self): + pass + def main(): ui = uimod.ui()