Skip to content

Commit

Permalink
Fix #1746 . Return missing result (#1748)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoomakethu authored Aug 26, 2023
1 parent cbbdf0f commit 126b5af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pymodbus/repl/client/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _print_command_help(self, commands):
)
)

def _process_client(self, text, client):
def _process_client(self, text, client) -> Result:
"""Process client commands."""
text = text.strip().split()
cmd = text[0].split(".")[1]
Expand All @@ -209,6 +209,7 @@ def _process_client(self, text, client):
else:
result = Result(getattr(client, cmd)(**kwargs))
result.print_result()
return result

def _process_result(self, text, result):
"""Process result commands."""
Expand All @@ -233,7 +234,7 @@ def run(self):
elif text.strip().lower() == "exit":
raise EOFError()
elif text.strip().lower().startswith("client."):
self._process_client(text, self.client)
result = self._process_client(text, self.client)
elif text.strip().lower().startswith("result.") and result:
self._process_result(text, result)
except KeyboardInterrupt:
Expand Down

0 comments on commit 126b5af

Please sign in to comment.