Skip to content

Commit 1812a9e

Browse files
committed
Fixup
1 parent 144e52e commit 1812a9e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

newrelic/hooks/framework_aiohttp.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,9 @@ def _nr_aiohttp_request_wrapper_(wrapped, instance, args, kwargs):
239239
return wrapped(*args, **kwargs)
240240

241241
method, url = _bind_request(*args, **kwargs)
242-
with ExternalTrace("aiohttp", str(url), method):
243-
return await wrapped(*args, **kwargs)
242+
trace = ExternalTrace("aiohttp", str(url), method)
243+
with trace:
244+
return wrapped(*args, **kwargs)
244245

245246

246247
def instrument_aiohttp_client(module):
@@ -251,9 +252,7 @@ def instrument_aiohttp_client_reqrep(module):
251252
version_info = aiohttp_version_info()
252253

253254
if version_info >= (2, 0):
254-
dt_wrapper = _nr_aiohttp_add_dt_headers_simple_
255-
256-
wrap_function_wrapper(module, "ClientRequest.send", dt_wrapper)
255+
wrap_function_wrapper(module, "ClientRequest.send", _nr_aiohttp_add_dt_headers_simple_)
257256

258257

259258
def instrument_aiohttp_protocol(module):

0 commit comments

Comments
 (0)