File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import struct
22import logging
3- from distutils .version import LooseVersion
3+ from packaging .version import Version
44
55import pymysql
66from pymysql .constants .COMMAND import COM_BINLOG_DUMP , COM_REGISTER_SLAVE
@@ -329,7 +329,7 @@ def _register_slave(self):
329329
330330 packet = self .report_slave .encoded (self .__server_id )
331331
332- if pymysql .__version__ < LooseVersion ("0.6" ):
332+ if Version ( pymysql .__version__ ) < Version ("0.6" ):
333333 self ._stream_connection .wfile .write (packet )
334334 self ._stream_connection .wfile .flush ()
335335 self ._stream_connection .read_packet ()
@@ -501,7 +501,7 @@ def __connect_to_stream(self):
501501 # encoded_data
502502 prelude += gtid_set .encoded ()
503503
504- if pymysql .__version__ < LooseVersion ("0.6" ):
504+ if Version ( pymysql .__version__ ) < Version ("0.6" ):
505505 self ._stream_connection .wfile .write (prelude )
506506 self ._stream_connection .wfile .flush ()
507507 else :
@@ -587,7 +587,7 @@ def fetchone(self):
587587 self .__connect_to_ctl ()
588588
589589 try :
590- if pymysql .__version__ < LooseVersion ("0.6" ):
590+ if Version ( pymysql .__version__ ) < Version ("0.6" ):
591591 pkt = self ._stream_connection .read_packet ()
592592 else :
593593 pkt = self ._stream_connection ._read_packet ()
You can’t perform that action at this time.
0 commit comments