From 1800b4982290175843937d749188cd5c01e3fc16 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Mon, 3 Feb 2020 11:36:26 -0500 Subject: [PATCH] fix a py2/py3 compat bug in the settings CLI --- awxkit/awxkit/cli/custom.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/awxkit/awxkit/cli/custom.py b/awxkit/awxkit/cli/custom.py index 0d46e40b88..81a189169a 100644 --- a/awxkit/awxkit/cli/custom.py +++ b/awxkit/awxkit/cli/custom.py @@ -1,7 +1,7 @@ import functools import json -from six import with_metaclass +from six import with_metaclass, PY3 from .stdout import monitor, monitor_workflow from .utils import CustomRegistryMeta, color_enabled @@ -547,8 +547,11 @@ class SettingsModify(CustomAction): return resp.from_json({'key': key, 'value': resp[key]}) def is_json(self, data): + err = ValueError + if PY3: + err = json.decoder.JSONDecodeError try: json.loads(data) - except json.decoder.JSONDecodeError: + except err: return False return True