Proper usage of asyncio exceptions
They belong to the asyncio package, not asyncio.exceptions. Also remove an unused Tuple import
This commit is contained in:
parent
0672d41431
commit
c4be4d79ed
|
@ -13,7 +13,7 @@
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
from typing import Dict, Any, Callable, Awaitable, List, Optional, Tuple
|
from typing import Dict, Any, Callable, Awaitable, List, Optional
|
||||||
import logging
|
import logging
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
|
@ -158,10 +158,10 @@ class RPCClient:
|
||||||
try:
|
try:
|
||||||
line += await self._reader.readuntil()
|
line += await self._reader.readuntil()
|
||||||
break
|
break
|
||||||
except asyncio.exceptions.IncompleteReadError as e:
|
except asyncio.IncompleteReadError as e:
|
||||||
line += e.partial
|
line += e.partial
|
||||||
break
|
break
|
||||||
except asyncio.exceptions.LimitOverrunError as e:
|
except asyncio.LimitOverrunError as e:
|
||||||
self.log.warning(f"Buffer overrun: {e}")
|
self.log.warning(f"Buffer overrun: {e}")
|
||||||
line += await self._reader.read(self._reader._limit)
|
line += await self._reader.read(self._reader._limit)
|
||||||
if not line:
|
if not line:
|
||||||
|
|
Loading…
Reference in New Issue