File: use-raw-strings-to-avoid-warning.patch

package info (click to toggle)
testrepository 0.0.21-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 884 kB
  • sloc: python: 5,729; makefile: 148; sh: 17
file content (44 lines) | stat: -rw-r--r-- 2,110 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Description: Use raw strings to avoid warning
Author: Thomas Goirand <zigo@debian.org>
Bug-Debian: https://bugs.debian.org/1081442
Forwarded: no
Last-Update: 2024-09-12

--- testrepository-0.0.21.orig/testrepository/testcommand.py
+++ testrepository-0.0.21/testrepository/testcommand.py
@@ -189,7 +189,7 @@ class TestListingFixture(Fixture):
 
     def setUp(self):
         super(TestListingFixture, self).setUp()
-        variable_regex = '\$(IDOPTION|IDFILE|IDLIST|LISTOPT)'
+        variable_regex = r'\$(IDOPTION|IDFILE|IDLIST|LISTOPT)'
         variables = {}
         list_variables = {'LISTOPT': self.listopt}
         cmd = self.template
@@ -328,7 +328,7 @@ class TestListingFixture(Fixture):
                     # --list-tests cannot use FILES, so handle it being unset.
                     'FILES': getattr(self, 'list_file_name', None) or '',
                 }
-                variable_regex = '\$(INSTANCE_ID|COMMAND|FILES)'
+                variable_regex = r'\$(INSTANCE_ID|COMMAND|FILES)'
                 def subst(match):
                     return variables.get(match.groups(1)[0], '')
                 cmd = re.sub(variable_regex, subst, instance_prefix)
@@ -507,7 +507,7 @@ class TestCommand(Fixture):
             dispose_cmd = self.get_parser().get('DEFAULT', 'instance_dispose')
         except (ValueError, configparser.NoOptionError):
             return
-        variable_regex = '\$INSTANCE_IDS'
+        variable_regex = r'\$INSTANCE_IDS'
         dispose_cmd = re.sub(variable_regex, ' '.join(sorted(instance.decode('utf') for instance in instances)),
             dispose_cmd)
         self.ui.output_values([('running', dispose_cmd)])
@@ -607,7 +607,7 @@ class TestCommand(Fixture):
             except configparser.NoOptionError:
                 # Instance allocation not configured
                 return None
-            variable_regex = '\$INSTANCE_COUNT'
+            variable_regex = r'\$INSTANCE_COUNT'
             cmd = re.sub(variable_regex,
                 str(concurrency - len(self._instances)), cmd)
             self.ui.output_values([('running', cmd)])