aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjun <pkillarjun@protonmail.com>2024-05-09 20:47:08 +0530
committerGreg Hudson <ghudson@mit.edu>2024-05-22 17:15:01 -0400
commit4b21b2e2821d3cb91042be09e0ebe09707a57d72 (patch)
treebdd33867a18f957c1af0810e70298e5653b4ac91
parent623d649ba852839ba4822934bad9f97c184bf3ab (diff)
downloadkrb5-4b21b2e2821d3cb91042be09e0ebe09707a57d72.zip
krb5-4b21b2e2821d3cb91042be09e0ebe09707a57d72.tar.gz
krb5-4b21b2e2821d3cb91042be09e0ebe09707a57d72.tar.bz2
Fix Python regexp literals
Add missing "r" prefixes before literals using regexp escape sequences. [ghudson@mit.edu: split into separate commit; rewrote commit message]
-rw-r--r--src/util/cstyle-file.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/cstyle-file.py b/src/util/cstyle-file.py
index 837fa05..56b1e32 100644
--- a/src/util/cstyle-file.py
+++ b/src/util/cstyle-file.py
@@ -208,7 +208,7 @@ def check_assignment_in_conditional(line, ln):
def indent(line):
- return len(re.match('\s*', line).group(0).expandtabs())
+ return len(re.match(r'\s*', line).group(0).expandtabs())
def check_unbraced_flow_body(line, ln, lines):
@@ -220,8 +220,8 @@ def check_unbraced_flow_body(line, ln, lines):
if m and (m.group(1) is None) != (m.group(3) is None):
warn(ln, 'One arm of if/else statement braced but not the other')
- if (re.match('\s*(if|else if|for|while)\s*\(.*\)$', line) or
- re.match('\s*else$', line)):
+ if (re.match(r'\s*(if|else if|for|while)\s*\(.*\)$', line) or
+ re.match(r'\s*else$', line)):
base = indent(line)
# Look at the next two lines (ln is 1-based so lines[ln] is next).
if indent(lines[ln]) > base and indent(lines[ln + 1]) > base: