From 311b9243e1fa2ee7ff4992bb7465ef3292f85a7d Mon Sep 17 00:00:00 2001 From: Aetias Date: Sat, 18 Jan 2025 13:48:30 +0100 Subject: [PATCH] Use named arguments in `re` module Some positional arguments have become deprecated --- tools/m2ctx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/m2ctx.py b/tools/m2ctx.py index dc43f326..edac88da 100755 --- a/tools/m2ctx.py +++ b/tools/m2ctx.py @@ -37,8 +37,8 @@ COMMENT_REGEX = r'\/\/.*$|\/\*(?:.|\r|\n)+?\*\/' with open(args.file, 'r') as f: contents = f.read() -contents = re.sub(COMMENT_REGEX, '', contents, 0, re.MULTILINE) -includes = re.findall(INCLUDE_REGEX, contents, re.MULTILINE) +contents = re.sub(COMMENT_REGEX, '', contents, count=0, flags=re.MULTILINE) +includes = re.findall(INCLUDE_REGEX, contents, flags=re.MULTILINE) _, suffix = os.path.splitext(args.file)