From: Thierry Parmentelat Date: Fri, 21 Nov 2025 10:35:28 +0000 (+0100) Subject: protect regexps as raw-strings X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=6457ec0a59aace467d1cc622c98f86ecc915be48;p=plcapi.git protect regexps as raw-strings --- diff --git a/PLC/Methods/GetPlcRelease.py b/PLC/Methods/GetPlcRelease.py index 07b16f8e..99603fe0 100644 --- a/PLC/Methods/GetPlcRelease.py +++ b/PLC/Methods/GetPlcRelease.py @@ -4,12 +4,12 @@ from PLC.Faults import * import re -comment_regexp = '\A\s*#.|\A\s*\Z|\Axxxxx' +comment_regexp = r'\A\s*#.|\A\s*\Z|\Axxxxx' -regexps = { 'build' : '\A[bB]uild\s+(?P[^:]+)\s*:\s*(?P.*)\Z', - 'tags' : '\A(?P[^:]+)\s*:=\s*(?P.*)\Z', +regexps = { 'build' : r'\A[bB]uild\s+(?P[^:]+)\s*:\s*(?P.*)\Z', + 'tags' : r'\A(?P[^:]+)\s*:=\s*(?P.*)\Z', # spaces not part of key : ungreedy - 'rpms' : '\A(?P[^:]+?)\s*::\s*(?P.*)\Z', + 'rpms' : r'\A(?P[^:]+?)\s*::\s*(?P.*)\Z', } class GetPlcRelease(Method):