remove python2 support from awxkit

This commit is contained in:
Ryan Petrello
2020-03-18 09:06:20 -04:00
parent db7f0f9421
commit 06b3e54fb1
18 changed files with 27 additions and 116 deletions

View File

@@ -1,8 +1,6 @@
import functools
import json
from six import with_metaclass, PY3
from .stdout import monitor, monitor_workflow
from .utils import CustomRegistryMeta, color_enabled
from awxkit import api
@@ -24,7 +22,7 @@ class CustomActionRegistryMeta(CustomRegistryMeta):
return ' '.join([self.resource, self.action])
class CustomAction(with_metaclass(CustomActionRegistryMeta)):
class CustomAction(metaclass=CustomActionRegistryMeta):
"""Base class for defining a custom action for a resource."""
def __init__(self, page):
@@ -549,11 +547,8 @@ 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 err:
except json.decoder.JSONDecodeError:
return False
return True