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 1
1
import struct
2
2
import logging
3
- from distutils .version import LooseVersion
3
+ from packaging .version import Version
4
4
5
5
import pymysql
6
6
from pymysql .constants .COMMAND import COM_BINLOG_DUMP , COM_REGISTER_SLAVE
@@ -329,7 +329,7 @@ def _register_slave(self):
329
329
330
330
packet = self .report_slave .encoded (self .__server_id )
331
331
332
- if pymysql .__version__ < LooseVersion ("0.6" ):
332
+ if Version ( pymysql .__version__ ) < Version ("0.6" ):
333
333
self ._stream_connection .wfile .write (packet )
334
334
self ._stream_connection .wfile .flush ()
335
335
self ._stream_connection .read_packet ()
@@ -501,7 +501,7 @@ def __connect_to_stream(self):
501
501
# encoded_data
502
502
prelude += gtid_set .encoded ()
503
503
504
- if pymysql .__version__ < LooseVersion ("0.6" ):
504
+ if Version ( pymysql .__version__ ) < Version ("0.6" ):
505
505
self ._stream_connection .wfile .write (prelude )
506
506
self ._stream_connection .wfile .flush ()
507
507
else :
@@ -587,7 +587,7 @@ def fetchone(self):
587
587
self .__connect_to_ctl ()
588
588
589
589
try :
590
- if pymysql .__version__ < LooseVersion ("0.6" ):
590
+ if Version ( pymysql .__version__ ) < Version ("0.6" ):
591
591
pkt = self ._stream_connection .read_packet ()
592
592
else :
593
593
pkt = self ._stream_connection ._read_packet ()
You can’t perform that action at this time.
0 commit comments