Skip to content

Commit 6d15d44

Browse files
committed
use async_timeout instead of aiohttp.Timeout (#157)
aiohttp.Timeout was removed in aiohttp 3.0 closes #157
1 parent 593e1c7 commit 6d15d44

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

CHANGELOG.asciidoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
[[changelog]]
77
== Changelog
88

9-
//
10-
//[[release-next]]
11-
//[float]
12-
//=== Unreleased
13-
//https://github.com/elastic/apm-agent-python/compare/v1.0.0\...master[Check the HEAD diff]
9+
10+
[[release-next]]
11+
[float]
12+
=== Unreleased
13+
https://github.com/elastic/apm-agent-python/compare/v2.0.0\...master[Check the HEAD diff]
14+
15+
* fixed compatibility issue with aiohttp 3.0 ({pull}157[#157])
1416

1517
[[release-2.0.0]]
1618
[float]

elasticapm/transport/asyncio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22

33
import aiohttp
4+
import async_timeout
45

56
from .base import TransportException
67
from .http_base import HTTPTransportBase
@@ -23,7 +24,7 @@ async def send(self, data, headers, timeout=None):
2324
"""Use synchronous interface, because this is a coroutine."""
2425

2526
try:
26-
with aiohttp.Timeout(timeout):
27+
with async_timeout.timeout(timeout):
2728
async with self.client.post(self._url,
2829
data=data,
2930
headers=headers) as response:

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ multi_line_output=0
2525
known_standard_library=importlib,types,asyncio
2626
known_django=django
2727
known_first_party=elasticapm,tests
28-
known_third_party=pytest,flask,aiohttp,urllib3_mock,webob,memcache,pymongo,boto3,logbook,twisted,celery,zope,urllib3,redis,jinja2,requests,certifi,mock,jsonschema,werkzeug,pytest_localserver,psycopg2
28+
known_third_party=pytest,flask,aiohttp,urllib3_mock,webob,memcache,pymongo,boto3,logbook,twisted,celery,zope,urllib3,redis,jinja2,requests,certifi,mock,jsonschema,werkzeug,pytest_localserver,psycopg2,async_timeout
2929
default_section=FIRSTPARTY
3030
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
3131

0 commit comments

Comments
 (0)