Skip to content
This repository has been archived by the owner on Aug 5, 2023. It is now read-only.

Commit

Permalink
Suppress warning from aiohttp 3.5 (related: aio-libs/aiohttp#3333)
Browse files Browse the repository at this point in the history
  • Loading branch information
gusutabopb committed Feb 1, 2019
1 parent febfe47 commit da950e9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions aioinflux/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ def __init__(
:param loop: Asyncio event loop.
"""
self._loop = asyncio.get_event_loop() if loop is None else loop
self._session = aiohttp.ClientSession(
loop=self._loop,
auth=aiohttp.BasicAuth(username, password) if username and password else None,
connector=aiohttp.UnixConnector(path=unix_socket,
loop=self._loop) if unix_socket else None,
)
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
self._session = aiohttp.ClientSession(
loop=self._loop,
auth=aiohttp.BasicAuth(username, password) if username and password else None,
connector=aiohttp.UnixConnector(path=unix_socket,
loop=self._loop) if unix_socket else None,
)
self._url = f'{"https" if ssl else "http"}://{host}:{port}/{{endpoint}}'
self.host = host
self.port = port
Expand Down

0 comments on commit da950e9

Please sign in to comment.