From 335d67c9d28979b3ea72fdebfe49b1d28136788a Mon Sep 17 00:00:00 2001 From: evilchili Date: Sat, 10 Dec 2022 10:38:11 -0800 Subject: [PATCH] fix subshell returns --- groove/shell/interactive_shell.py | 4 ++-- groove/shell/playlist.py | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/groove/shell/interactive_shell.py b/groove/shell/interactive_shell.py index 68bfaba..82cc896 100644 --- a/groove/shell/interactive_shell.py +++ b/groove/shell/interactive_shell.py @@ -54,8 +54,8 @@ class CommandPrompt(BasePrompt): session=self.manager.session, create_ok=True ) - res = self.commands['_playlist'].start() - return True and res + self.commands['_playlist'].start() + return True def start(): # pragma: no cover diff --git a/groove/shell/playlist.py b/groove/shell/playlist.py index 11e495d..337e110 100644 --- a/groove/shell/playlist.py +++ b/groove/shell/playlist.py @@ -35,12 +35,10 @@ class _playlist(BasePrompt): return self._commands def process(self, cmd, *parts): - res = True if cmd in self.commands: - res = self.commands[cmd](parts) - else: - print(f"Command not understood: {cmd}") - return res is True + return True if self.commands[cmd](parts) else False + print(f"Command not understood: {cmd}") + return True def show(self, parts): print(self.parent.playlist)