فهرست منبع

cpplint: fix deprecation warnings with docstrings

Fix warnings with Python 3.8 like:
.../depot_tools/cpplint.py:3006: DeprecationWarning: invalid escape sequence \%
  """Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
.../depot_tools/cpplint.py:4842: DeprecationWarning: invalid escape sequence \(
  """Retrieves all the text between matching open and close parentheses.

Change-Id: I99987e766cda98e2b8d8476f7900b9f99d58761e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5328187
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Mike Frysinger 1 سال پیش
والد
کامیت
d972b831c3
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      cpplint.py

+ 2 - 2
cpplint.py

@@ -3003,7 +3003,7 @@ class NestingState(object):
 
 def CheckForNonStandardConstructs(filename, clean_lines, linenum, nesting_state,
                                   error):
-    """Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
+    r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
 
     Complain about several constructs which gcc-2 accepts, but which are
     not standard C++.  Warning about these in lint is one way to ease the
@@ -4839,7 +4839,7 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
 
 
 def _GetTextInside(text, start_pattern):
-    """Retrieves all the text between matching open and close parentheses.
+    r"""Retrieves all the text between matching open and close parentheses.
 
     Given a string of lines and a regular expression string, retrieve all the text
     following the expression and between opening punctuation symbols like