From 7e4033ce8169fd2532eb1029ff579bbd0cfd8c21 Mon Sep 17 00:00:00 2001 From: fazledyn-or Date: Thu, 16 Nov 2023 16:12:46 +0600 Subject: [PATCH 1/2] Replaced `NotImplementedError` with `NotImplemented` Signed-off-by: fazledyn-or --- plumbum/machines/paramiko_machine.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plumbum/machines/paramiko_machine.py b/plumbum/machines/paramiko_machine.py index ab56c2ed..163fadf8 100644 --- a/plumbum/machines/paramiko_machine.py +++ b/plumbum/machines/paramiko_machine.py @@ -190,22 +190,22 @@ class ParamikoMachine(BaseRemoteMachine): class RemoteCommand(BaseRemoteMachine.RemoteCommand): # type: ignore[valid-type, misc] def __or__(self, *_): - raise NotImplementedError("Not supported with ParamikoMachine") + return NotImplemented def __gt__(self, *_): - raise NotImplementedError("Not supported with ParamikoMachine") + return NotImplemented def __rshift__(self, *_): - raise NotImplementedError("Not supported with ParamikoMachine") + return NotImplemented def __ge__(self, *_): - raise NotImplementedError("Not supported with ParamikoMachine") + return NotImplemented def __lt__(self, *_): - raise NotImplementedError("Not supported with ParamikoMachine") + return NotImplemented def __lshift__(self, *_): - raise NotImplementedError("Not supported with ParamikoMachine") + return NotImplemented def __init__( self, From 71508bed9bf1d12ade1fb0cb2c863b10b2cdae73 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 5 Oct 2024 01:30:26 -0400 Subject: [PATCH 2/2] tests: adapt to correct error Signed-off-by: Henry Schreiner --- tests/test_remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_remote.py b/tests/test_remote.py index 0bd44fb1..b46bba50 100644 --- a/tests/test_remote.py +++ b/tests/test_remote.py @@ -628,7 +628,7 @@ def test_piping(self): with self._connect() as rem: try: rem["ls"] | rem["cat"] - except NotImplementedError: + except (NotImplementedError, TypeError): pass else: pytest.fail("Should not pipe")