There was an error while loading. Please reload this page.
1 parent 7c9bbda commit da75623Copy full SHA for da75623
pymysqlreplication/gtid.py
@@ -284,11 +284,14 @@ def decode(cls, payload):
284
start, end = struct.unpack("<QQ", payload.read(16))
285
intervals.append((start, end - 1))
286
287
- temp = ":".join(
288
- ["%d-%d" % x if isinstance(x, tuple) else "%d" % x for x in intervals]
289
- )
+ def format_interval(x):
+ if isinstance(x, tuple):
+ return f"{x[0]}-{x[1]}"
290
+ return f"{x}"
291
+
292
+ intervals_string = ":".join([format_interval(x) for x in intervals])
293
- return cls(f"{sid.decode('ascii')}:{temp}")
294
+ return cls(f"{sid.decode('ascii')}:{intervals_string}")
295
296
def __eq__(self, other):
297
if other.sid != self.sid:
0 commit comments