Absolute import some circular dependencies to appease Python 3.4.

This commit is contained in:
Rapptz
2016-12-24 05:11:06 -05:00
parent a1c81419b7
commit 79a49f9145
14 changed files with 108 additions and 88 deletions

View File

@ -36,7 +36,9 @@ from random import randint as random_integer
log = logging.getLogger(__name__)
from .errors import HTTPException, Forbidden, NotFound, LoginFailure, GatewayNotFound
from . import utils, __version__
from . import __version__
import discord.utils
@asyncio.coroutine
def json_or_text(response):
@ -97,7 +99,7 @@ class HTTPClient:
# some checking if it's a JSON request
if 'json' in kwargs:
headers['Content-Type'] = 'application/json'
kwargs['data'] = utils.to_json(kwargs.pop('json'))
kwargs['data'] = discord.utils.to_json(kwargs.pop('json'))
kwargs['headers'] = headers
with (yield from lock):
@ -244,7 +246,7 @@ class HTTPClient:
if embed:
payload['embed'] = embed
form.add_field('payload_json', utils.to_json(payload))
form.add_field('payload_json', discord.utils.to_json(payload))
form.add_field('file', buffer, filename=filename, content_type='application/octet-stream')
return self.post(url, data=form, bucket='messages:' + str(guild_id))