File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1313/pymysql /tests /databases.json
1414__pycache__
1515Pipfile.lock
16+ pdm.lock
Original file line number Diff line number Diff line change @@ -1370,7 +1370,7 @@ def send_data(self):
13701370 """Send data packets from the local file to the server"""
13711371 if not self .connection ._sock :
13721372 raise err .InterfaceError (0 , "" )
1373- conn = self .connection
1373+ conn : Connection = self .connection
13741374
13751375 try :
13761376 with open (self .filename , "rb" ) as open_file :
@@ -1388,5 +1388,6 @@ def send_data(self):
13881388 f"Can't find file '{ self .filename } '" ,
13891389 )
13901390 finally :
1391- # send the empty packet to signify we are done sending data
1392- conn .write_packet (b"" )
1391+ if not conn ._closed :
1392+ # send the empty packet to signify we are done sending data
1393+ conn .write_packet (b"" )
You can’t perform that action at this time.
0 commit comments