From 4aa6a65e6cdbe045e995e3c1bb87307cf7fe5d53 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 17 Aug 2023 09:55:19 -0400 Subject: [PATCH] Work around strange Python anomaly Apparently, `True` is both an instance of `int` and `bool`, which is a change and is very strange. Instead flip the conditional here. --- client-cli/pvc/cli/cli.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client-cli/pvc/cli/cli.py b/client-cli/pvc/cli/cli.py index 68cbe7f4..ec269d0d 100644 --- a/client-cli/pvc/cli/cli.py +++ b/client-cli/pvc/cli/cli.py @@ -93,14 +93,14 @@ def finish(success=True, data=None, formatter=None): else: echo(CLI_CONFIG, data) - # Allow passing - if isinstance(success, int): - exit(success) - - if success: - exit(0) + # Allow passing raw values if not a bool + if isinstance(success, bool): + if success: + exit(0) + else: + exit(1) else: - exit(1) + exit(success) def version(ctx, param, value):