From c4be4d79edc5a3b55c38a89ef103b3a05ae4542f Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Sat, 3 Jul 2021 12:49:21 -0400 Subject: [PATCH] Proper usage of asyncio exceptions They belong to the asyncio package, not asyncio.exceptions. Also remove an unused Tuple import --- matrix_puppeteer_line/rpc/rpc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matrix_puppeteer_line/rpc/rpc.py b/matrix_puppeteer_line/rpc/rpc.py index cad468b..83db369 100644 --- a/matrix_puppeteer_line/rpc/rpc.py +++ b/matrix_puppeteer_line/rpc/rpc.py @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from typing import Dict, Any, Callable, Awaitable, List, Optional, Tuple +from typing import Dict, Any, Callable, Awaitable, List, Optional import logging import asyncio import json @@ -158,10 +158,10 @@ class RPCClient: try: line += await self._reader.readuntil() break - except asyncio.exceptions.IncompleteReadError as e: + except asyncio.IncompleteReadError as e: line += e.partial break - except asyncio.exceptions.LimitOverrunError as e: + except asyncio.LimitOverrunError as e: self.log.warning(f"Buffer overrun: {e}") line += await self._reader.read(self._reader._limit) if not line: