Browse Source

autoninja.py: Fix "SyntaxWarning: invalid escape sequence '\s'"

Bug: None
Change-Id: Id19557ff5f115f1cacee85f113174535112f7c9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5854399
Commit-Queue: Philipp Wollermann <philwo@google.com>
Reviewed-by: Philipp Wollermann <philwo@google.com>
Auto-Submit: Max Ihlenfeldt <max@igalia.com>
Max Ihlenfeldt 11 tháng trước cách đây
mục cha
commit
62475a5ed8
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      autoninja.py

+ 2 - 2
autoninja.py

@@ -70,7 +70,7 @@ def _reclient_rbe_project():
         return ""
         return ""
     with open(reproxy_cfg_path) as f:
     with open(reproxy_cfg_path) as f:
         for line in f:
         for line in f:
-            m = re.match('instance\s*=\s*projects/([^/]*)/instances/.*', line)
+            m = re.match(r'instance\s*=\s*projects/([^/]*)/instances/.*', line)
             if m:
             if m:
                 return m[1]
                 return m[1]
     return ""
     return ""
@@ -89,7 +89,7 @@ def _siso_rbe_project():
         return ""
         return ""
     with open(sisoenv_path) as f:
     with open(sisoenv_path) as f:
         for line in f:
         for line in f:
-            m = re.match('SISO_PROJECT=\s*(\S*)\s*', line)
+            m = re.match(r'SISO_PROJECT=\s*(\S*)\s*', line)
             if m:
             if m:
                 return m[1]
                 return m[1]
     return ""
     return ""