mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
Do not show a zero error code when cli exits from showing help (#935)
asyncclick raises a custom runtime exception when exiting help. This suppresses reporting it.
This commit is contained in:
parent
c1e14832ef
commit
b217811096
@ -111,6 +111,10 @@ def CatchAllExceptions(cls):
|
||||
def _handle_exception(debug, exc):
|
||||
if isinstance(exc, click.ClickException):
|
||||
raise
|
||||
# Handle exit request from click.
|
||||
if isinstance(exc, click.exceptions.Exit):
|
||||
sys.exit(exc.exit_code)
|
||||
|
||||
echo(f"Raised error: {exc}")
|
||||
if debug:
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user