Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update restapi_invoker.py #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion huobi/client/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_account_by_type_and_symbol(self, account_type, symbol):
return None

async def async_get_account_balance(self, balance_full_url, account_id, ret_map):
async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
async with session.get(balance_full_url) as resp:
json = await resp.json()
ret_map[account_id] = json
Expand Down
6 changes: 5 additions & 1 deletion huobi/connection/impl/restapi_invoker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from huobi.exception.huobi_api_exception import HuobiApiException
from huobi.utils.etf_result import etf_result_check
from huobi.utils import *
import sys
import time

from huobi.utils.print_mix_object import TypeCheck
Expand Down Expand Up @@ -53,7 +54,10 @@ def call_sync(request, is_checked=False):
response = session.get(request.host + request.url, headers=request.header)
if is_checked is True:
return response.text
dict_data = json.loads(response.text, encoding="utf-8")
if sys.version_info.major >= 3 and sys.version_info.minor >= 9:
dict_data = json.loads(response.text)
else:
dict_data = json.loads(response.text, encoding="utf-8")
# print("call_sync === recv data : ", dict_data)
check_response(dict_data)
return request.json_parser(dict_data)
Expand Down