File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 32
32
MYSQL_EXPECTED_ERROR_CODES = [2013 , 2006 ]
33
33
34
34
35
+ loose_version = LooseVersion ("0.6" )
36
+
37
+
35
38
class ReportSlave (object ):
36
39
37
40
"""Represent the values that you may report when connecting as a slave
@@ -260,7 +263,7 @@ def _register_slave(self):
260
263
261
264
packet = self .report_slave .encoded (self .__server_id )
262
265
263
- if pymysql .__version__ < LooseVersion ( "0.6" ) :
266
+ if pymysql .__version__ < loose_version :
264
267
self ._stream_connection .wfile .write (packet )
265
268
self ._stream_connection .wfile .flush ()
266
269
self ._stream_connection .read_packet ()
@@ -408,7 +411,7 @@ def __connect_to_stream(self):
408
411
# encoded_data
409
412
prelude += gtid_set .encoded ()
410
413
411
- if pymysql .__version__ < LooseVersion ( "0.6" ) :
414
+ if pymysql .__version__ < loose_version :
412
415
self ._stream_connection .wfile .write (prelude )
413
416
self ._stream_connection .wfile .flush ()
414
417
else :
@@ -425,7 +428,7 @@ def fetchone(self):
425
428
self .__connect_to_ctl ()
426
429
427
430
try :
428
- if pymysql .__version__ < LooseVersion ( "0.6" ) :
431
+ if pymysql .__version__ < loose_version :
429
432
pkt = self ._stream_connection .read_packet ()
430
433
else :
431
434
pkt = self ._stream_connection ._read_packet ()
You can’t perform that action at this time.
0 commit comments