Skip to content

Commit

Permalink
Fix InterfaceError response when connection lost (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
changj41 committed Jul 13, 2020
1 parent d895719 commit 466ecfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pymysql/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def _execute_command(self, command, sql):
:raise ValueError: If no username was specified.
"""
if not self._sock:
raise err.InterfaceError("(0, '')")
raise err.InterfaceError(0, '')

# If the last query was unbuffered, make sure it finishes before
# sending new commands
Expand Down Expand Up @@ -1253,7 +1253,7 @@ def __init__(self, filename, connection):
def send_data(self):
"""Send data packets from the local file to the server"""
if not self.connection._sock:
raise err.InterfaceError("(0, '')")
raise err.InterfaceError(0, '')
conn = self.connection

try:
Expand Down

0 comments on commit 466ecfe

Please sign in to comment.