From bbcf1a0bd4d6f699fa3c7e40372653aabc6b47f0 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 12 Nov 2017 11:14:51 +0530 Subject: [PATCH] Fix confusing return statements, closes #67. --- mitogen/ssh.py | 3 ++- mitogen/sudo.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mitogen/ssh.py b/mitogen/ssh.py index 53018389..ffc908bc 100644 --- a/mitogen/ssh.py +++ b/mitogen/ssh.py @@ -80,7 +80,8 @@ class Stream(mitogen.master.Stream): time.time() + 10.0): LOG.debug('%r: received %r', self, buf) if buf.endswith('EC0\n'): - return self._ec0_received() + self._ec0_received() + return elif PERMDENIED_PROMPT in buf.lower(): if self.password is not None and password_sent: raise PasswordError(self.password_incorrect_msg) diff --git a/mitogen/sudo.py b/mitogen/sudo.py index 8ea2913c..09cf9d9e 100644 --- a/mitogen/sudo.py +++ b/mitogen/sudo.py @@ -71,7 +71,8 @@ class Stream(mitogen.master.Stream): time.time() + 10.0): LOG.debug('%r: received %r', self, buf) if buf.endswith('EC0\n'): - return self._ec0_received() + self._ec0_received() + return elif PASSWORD_PROMPT in buf.lower(): if self.password is None: raise PasswordError(self.password_required_msg)