From 36c547ad504dea4ad14edf9072214113e3ab8fc6 Mon Sep 17 00:00:00 2001 From: Yuta Hayashibe Date: Sun, 2 Oct 2022 21:51:34 +0900 Subject: [PATCH] Fix bugs --- whispering/cli.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/whispering/cli.py b/whispering/cli.py index 9e4ddc8..4183860 100644 --- a/whispering/cli.py +++ b/whispering/cli.py @@ -235,10 +235,14 @@ def main() -> None: if opts.show_devices: return show_devices() - if opts.host is not None and opts.port is not None and opts.mode != Mode.client: - opts.mode = Mode.server + if ( + opts.host is not None + and opts.port is not None + and opts.mode != Mode.client.value + ): + opts.mode = Mode.server.value - if opts.mode == Mode.client: + if opts.mode == Mode.client.value: assert opts.language is None assert opts.model is None try: @@ -249,7 +253,7 @@ def main() -> None: ) except KeyboardInterrupt: pass - elif opts.mode == Mode.server: + elif opts.mode == Mode.server.value: assert opts.language is not None assert opts.model is not None wsp = get_wshiper(opts=opts)