Skip to content

Commit

Permalink
Fixed Improper Method Call: Replaced NotImplementedError (#667)
Browse files Browse the repository at this point in the history
* Replaced `NotImplementedError` with `NotImplemented`

Signed-off-by: fazledyn-or <[email protected]>

* tests: adapt to correct error

Signed-off-by: Henry Schreiner <[email protected]>

---------

Signed-off-by: fazledyn-or <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Co-authored-by: Henry Schreiner <[email protected]>
  • Loading branch information
fazledyn-or and henryiii authored Oct 5, 2024
1 parent 532257f commit fbf4955
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions plumbum/machines/paramiko_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit fbf4955

Please sign in to comment.