Skip to content

Commit 62cc6f6

Browse files
authored
Merge pull request #608 from bentsku/fix-log-statement
fix log statement for BinLogStreamReader.fetchone
2 parents 00364de + b49b760 commit 62cc6f6

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

pymysqlreplication/binlogstream.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -599,10 +599,11 @@ def fetchone(self):
599599
if code in MYSQL_EXPECTED_ERROR_CODES:
600600
self._stream_connection.close()
601601
self.__connected_stream = False
602-
logging.WARN(
602+
logging.log(
603+
logging.WARN,
603604
"""
604605
A pymysql.OperationalError error occurred, Re-request the connection.
605-
"""
606+
""",
606607
)
607608
continue
608609
raise
@@ -687,9 +688,9 @@ def fetchone(self):
687688
binlog_event.event_type == TABLE_MAP_EVENT
688689
and binlog_event.event is not None
689690
):
690-
self.table_map[
691-
binlog_event.event.table_id
692-
] = binlog_event.event.get_table()
691+
self.table_map[binlog_event.event.table_id] = (
692+
binlog_event.event.get_table()
693+
)
693694

694695
# event is none if we have filter it on packet level
695696
# we filter also not allowed events

pymysqlreplication/tests/binlogfilereader.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Read binlog files"""
2+
23
import struct
34

45
from pymysqlreplication import constants

pymysqlreplication/tests/test_abnormal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Test abnormal conditions, such as caused by a MySQL crash
22
"""
3+
34
import os.path
45

56
from pymysqlreplication.tests import base

0 commit comments

Comments
 (0)