Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Upgrade to aiohttp v3 (lablup/backend.ai-manager#64)
Browse files Browse the repository at this point in the history
* aiohttp.Timeout is dropped and now it is encouraged to use
  async_timeout directly.

* Requires pnuckowski/aioresponses#87 or pnuckowski/aioresponses#89 to
  be merged.
  • Loading branch information
achimnol committed Feb 12, 2018
1 parent 446b3da commit 83a2af5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ai/backend/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import uuid

import aiohttp
from async_timeout import timeout as _timeout


def env_info():
Expand Down Expand Up @@ -115,7 +116,7 @@ def readable_size_to_bytes(expr):
async def curl(url, default_value=None, params=None, headers=None, timeout=0.2):
try:
async with aiohttp.ClientSession() as sess:
with aiohttp.Timeout(timeout):
with _timeout(timeout):
async with sess.get(url, params=params, headers=headers) as resp:
assert resp.status == 200
body = await resp.text()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def read_src_version():
requires = [
'pyzmq',
'aiozmq',
'aiohttp~=2.3.0',
'aiohttp~=3.0.0',
'aiodns',
'async_timeout',
'etcd3~=0.7.0',
Expand Down

0 comments on commit 83a2af5

Please sign in to comment.