diff --git a/.travis.yml b/.travis.yml index 10dbf6c..57f8c1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: false language: python python: - - "3.5" + - "3.8" install: - pip install coveralls script: "./uranium test" diff --git a/README.rst b/README.rst index 23dfec4..23b1ebd 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -aiographite + aiographite =========== .. image:: https://travis-ci.org/zillow/aiographite.svg?branch=master diff --git a/aiographite/aiographite.py b/aiographite/aiographite.py index d972246..f487c17 100644 --- a/aiographite/aiographite.py +++ b/aiographite/aiographite.py @@ -29,12 +29,14 @@ class AioGraphiteSendException(Exception): class AIOGraphite: """ AIOGraphite is a Graphite client class, ultilizing asyncio, - designed to help Graphite users to send data into graphite easily. + designed to help Graphite users to send data into graphite easily.\ + + Removed loop parameter as it is removed from python 3.8 and above """ def __init__(self, graphite_server, graphite_port=DEFAULT_GRAPHITE_PLAINTEXT_PORT, - protocol=PlaintextProtocol(), loop=None, timeout=None): + protocol=PlaintextProtocol(), timeout=None): if not isinstance(protocol, (PlaintextProtocol, PickleProtocol)): raise AioGraphiteSendException("Unsupported Protocol!") self._graphite_server = graphite_server @@ -43,7 +45,6 @@ def __init__(self, graphite_server, self._reader, self._writer = None, None self._timeout = timeout self.protocol = protocol - self.loop = loop or asyncio.get_event_loop() async def __aenter__(self): await self._connect() @@ -99,13 +100,10 @@ async def _connect(self) -> None: try: self._reader, self._writer = await asyncio.open_connection( self._graphite_server, - self._graphite_port, - loop=self.loop) - except Exception: - raise AioGraphiteSendException( - "Unable to connect to the provided server address %s:%s" - % self._graphite_server_address - ) + self._graphite_port) + except Exception as e: + raise AioGraphiteSendException(f"Unable to connect to the provided server address " + f"{self._graphite_server_address} due to {e}") async def _disconnect(self) -> None: """ diff --git a/environment.yml b/environment.yml index ad6b6da..6562787 100644 --- a/environment.yml +++ b/environment.yml @@ -1,3 +1,3 @@ -name: py35 +name: py38 dependencies: - - python=3.5.1=0 \ No newline at end of file + - python=3.8.16=0 \ No newline at end of file