From 10f391eb93daa9ba788b277e6460272b0d1f6c34 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Fri, 7 Jun 2019 09:47:39 -0400 Subject: [PATCH] Make the regular expression strings raw. This gets rid of DepcreationWarning about backslashes when running under python with debug enabled. Signed-off-by: Chris Lalancette --- cmakelint/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmakelint/main.py b/cmakelint/main.py index 23fba6a..2820460 100644 --- a/cmakelint/main.py +++ b/cmakelint/main.py @@ -153,7 +153,7 @@ def Check(self, filename, linenumber, clean_lines, errors): def _GetExpected(self, filename): package = os.path.basename(filename) - package = re.sub('^Find(.*)\.cmake', lambda m: m.group(1), package) + package = re.sub(r'^Find(.*)\.cmake', lambda m: m.group(1), package) return package.upper() def Done(self, filename, errors): @@ -394,7 +394,7 @@ def CheckStyle(filename, linenumber, clean_lines, errors): CheckRepeatLogic(filename, linenumber, clean_lines, errors) def CheckFileName(filename, errors): - name_match = re.match('Find(.*)\.cmake', os.path.basename(filename)) + name_match = re.match(r'Find(.*)\.cmake', os.path.basename(filename)) if name_match: package = name_match.group(1) if not package.isupper():