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

@@ -4,8 +4,7 @@ import json
import re
from requests import Response
import six
from six.moves import http_client as http
import http.client as http
from awxkit.utils import (
PseudoNamespace,
@@ -170,10 +169,7 @@ class Page(object):
def from_json(cls, raw):
resp = Response()
data = json.dumps(raw)
if six.PY3:
resp._content = bytes(data, 'utf-8')
else:
resp._content = data
resp._content = bytes(data, 'utf-8')
resp.encoding = 'utf-8'
resp.status_code = 200
return cls(r=resp)