From 12da31a1bab9065a8d33fb03f697bea7b211ffa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0pa=C4=8Dek?= Date: Mon, 9 Oct 2017 15:07:46 +0200 Subject: [PATCH] Use call_soon() when closing in conn._read_data() Addresses issue #292 --- aioredis/connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aioredis/connection.py b/aioredis/connection.py index 580b250c9..20e0d1d0b 100644 --- a/aioredis/connection.py +++ b/aioredis/connection.py @@ -174,7 +174,7 @@ def _read_data(self): if self._in_transaction is not None: self._transaction_error = exc self._closing = True - self._do_close(exc) + self._loop.call_soon(self._do_close, exc) return except Exception as exc: # XXX: for QUIT command connection error can be received @@ -193,7 +193,7 @@ def _read_data(self): self._process_data(obj) self._closing = True - self._do_close(None) + self._loop.call_soon(self._do_close, None) def _process_data(self, obj): """Processes command results."""