Skip to content

Commit

Permalink
Fix #454
Browse files Browse the repository at this point in the history
  • Loading branch information
dongweiming committed Dec 28, 2019
1 parent b16e5bd commit fd4174f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aiomysql/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
import configparser
import getpass
from functools import partial
try:
from asyncio.streams import IncompleteReadError
except ImportError:
from asyncio.exceptions import IncompleteReadError

from pymysql.charset import charset_by_name, charset_by_id
from pymysql.constants import SERVER_STATUS
Expand Down Expand Up @@ -596,7 +600,7 @@ async def _read_packet(self, packet_type=MysqlPacket):
async def _read_bytes(self, num_bytes):
try:
data = await self._reader.readexactly(num_bytes)
except asyncio.streams.IncompleteReadError as e:
except IncompleteReadError as e:
msg = "Lost connection to MySQL server during query"
raise OperationalError(2013, msg) from e
except (IOError, OSError) as e:
Expand Down

0 comments on commit fd4174f

Please sign in to comment.