File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 3232MYSQL_EXPECTED_ERROR_CODES = [2013 , 2006 ]
3333
3434
35+ loose_version = LooseVersion ("0.6" )
36+
37+
3538class ReportSlave (object ):
3639
3740 """Represent the values that you may report when connecting as a slave
@@ -260,7 +263,7 @@ def _register_slave(self):
260263
261264 packet = self .report_slave .encoded (self .__server_id )
262265
263- if pymysql .__version__ < LooseVersion ( "0.6" ) :
266+ if pymysql .__version__ < loose_version :
264267 self ._stream_connection .wfile .write (packet )
265268 self ._stream_connection .wfile .flush ()
266269 self ._stream_connection .read_packet ()
@@ -408,7 +411,7 @@ def __connect_to_stream(self):
408411 # encoded_data
409412 prelude += gtid_set .encoded ()
410413
411- if pymysql .__version__ < LooseVersion ( "0.6" ) :
414+ if pymysql .__version__ < loose_version :
412415 self ._stream_connection .wfile .write (prelude )
413416 self ._stream_connection .wfile .flush ()
414417 else :
@@ -425,7 +428,7 @@ def fetchone(self):
425428 self .__connect_to_ctl ()
426429
427430 try :
428- if pymysql .__version__ < LooseVersion ( "0.6" ) :
431+ if pymysql .__version__ < loose_version :
429432 pkt = self ._stream_connection .read_packet ()
430433 else :
431434 pkt = self ._stream_connection ._read_packet ()
You can’t perform that action at this time.
0 commit comments