File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -114,8 +114,11 @@ def __connect_to_stream(self):
114114 prelude += struct .pack ('<I' , self .__server_id )
115115 prelude += self .log_file .encode ()
116116
117- self ._stream_connection .wfile .write (prelude )
118- self ._stream_connection .wfile .flush ()
117+ if pymysql .VERSION < (0 , 6 , None ):
118+ self ._stream_connection .wfile .write (prelude )
119+ self ._stream_connection .wfile .flush ()
120+ else :
121+ self ._stream_connection ._write_bytes (prelude )
119122 self .__connected_stream = True
120123
121124 def fetchone (self ):
@@ -127,7 +130,10 @@ def fetchone(self):
127130 self .__connect_to_ctl ()
128131
129132 try :
130- pkt = self ._stream_connection .read_packet ()
133+ if pymysql .VERSION < (0 , 6 , None ):
134+ pkt = self ._stream_connection .read_packet ()
135+ else :
136+ pkt = self ._stream_connection ._read_packet ()
131137 except pymysql .OperationalError as error :
132138 code , message = error .args
133139 # 2013: Connection Lost
You can’t perform that action at this time.
0 commit comments