summaryrefslogtreecommitdiff
path: root/bin/find-german-comments
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-07-08 11:51:48 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-07-13 22:23:44 +0200
commitbd96a6f7b7eb103f97bcd6eadc21908187e94dce (patch)
treec4ace9ff4cab817915c9b00496a79e83ea2f7a34 /bin/find-german-comments
parenta3c3ab7394f578340c33e6e1cd8da13196a8b596 (diff)
Don't rely on Python's treatment of unrecognized escape sequences
According to [1]: > Changed in version 3.6: Unrecognized escape sequences produce a DeprecationWarning. > In a future Python version they will be a SyntaxWarning and eventually a SyntaxError. [1] https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals Change-Id: Ia4f79f17ccb121f423f35b1e1306d5ae285e8762 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98321 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'bin/find-german-comments')
-rwxr-xr-xbin/find-german-comments6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/find-german-comments b/bin/find-german-comments
index f26de960f2d9..98ae5acfcee7 100755
--- a/bin/find-german-comments
+++ b/bin/find-german-comments
@@ -96,12 +96,12 @@ class Parser:
# start of a real multiline comment
in_comment = True
linenum = count
- s = re.sub(".*/\*+", "", i.strip(self.strip))
+ s = re.sub(r".*/\*+", "", i.strip(self.strip))
if len(s):
buf.append(s.strip(self.strip))
elif in_comment and not "*/" in i:
# in multiline comment
- s = re.sub("^( |\|)*\*?", "", i)
+ s = re.sub(r"^( |\|)*\*?", "", i)
if len(s.strip(self.strip)):
buf.append(s.strip(self.strip))
elif "*/" in i and in_comment:
@@ -114,7 +114,7 @@ class Parser:
buf = []
elif "/*" in i and "*/" in i:
# c-style oneliner comment
- yield (count, re.sub(".*/\*(.*)\*/.*", r"\1", i).strip(self.strip))
+ yield (count, re.sub(r".*/\*(.*)\*/.*", r"\1", i).strip(self.strip))
count += 1
def start_text_cat(self):