From 557632253f2e6e068379ade2349567d20c253e50 Mon Sep 17 00:00:00 2001 From: Chris Putnam Date: Mon, 11 Dec 2023 19:51:17 -0600 Subject: [PATCH] use raw strings for regexes, avoids syntax warnings in 3.12 --- binmerge | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/binmerge b/binmerge index 4d792df..1845498 100755 --- a/binmerge +++ b/binmerge @@ -108,7 +108,7 @@ def read_cue_file(cue_path): f = open(cue_path, 'r') for line in f: - m = re.search('FILE "?(.*?)"? BINARY', line) + m = re.search(r'FILE "?(.*?)"? BINARY', line) if m: this_path = os.path.join(os.path.dirname(cue_path), m.group(1)) if not (os.path.isfile(this_path) or os.access(this_path, os.R_OK)): @@ -119,13 +119,13 @@ def read_cue_file(cue_path): files.append(this_file) continue - m = re.search('TRACK (\d+) ([^\s]*)', line) + m = re.search(r'TRACK (\d+) ([^\s]*)', line) if m and this_file: this_track = Track(int(m.group(1)), m.group(2)) this_file.tracks.append(this_track) continue - m = re.search('INDEX (\d+) (\d+:\d+:\d+)', line) + m = re.search(r'INDEX (\d+) (\d+:\d+:\d+)', line) if m and this_track: this_track.indexes.append({'id': int(m.group(1)), 'stamp': m.group(2), 'file_offset':cuestamp_to_sectors(m.group(2))}) continue @@ -166,7 +166,7 @@ def sectors_to_cuestamp(sectors): def cuestamp_to_sectors(stamp): # 75 sectors per second - m = re.match("(\d+):(\d+):(\d+)", stamp) + m = re.match(r"(\d+):(\d+):(\d+)", stamp) minutes = int(m.group(1)) seconds = int(m.group(2)) fields = int(m.group(3))