chiark / gitweb /
Escape: Add missing r in regexp literals ('...' => r'...') [7]
[git-buildpackage.git] / gbp / scripts / common / pq.py
index b6033a2830601dede3f059de210ef04dbe9ef0c9..73d419c563669100905cd56bfd0f32f2f2ac420f 100644 (file)
@@ -152,7 +152,7 @@ def write_patch_file(filename, commit_info, diff):
             name = commit_info['author']['name']
             email = commit_info['author']['email']
             # Git compat: put name in quotes if special characters found
-            if re.search("[,.@()\[\]\\\:;]", name):
+            if re.search(r"[,.@()\[\]\\\:;]", name):
                 name = '"%s"' % name
             from_header = Header(header_name='from')
             try:
@@ -216,7 +216,7 @@ def format_patch(outdir, repo, commit_info, series, abbrev, numbered=True,
         if renumber:
             # Remove any existing numeric prefix if the patch
             # should be renumbered
-            name = re.sub('^\d+[-_]*', '', name)
+            name = re.sub(r'^\d+[-_]*', '', name)
         else:
             # Otherwise, clear proposed prefix
             num_prefix = ''