[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/scripts: Fix regex syntax warnings with Python 3.12



commit 4288576c161bf1204f2295e43cf70839a25828a8
Author:     Ariel Otilibili <Ariel.Otilibili-Anieli@xxxxxxxxxx>
AuthorDate: Thu Dec 19 19:10:43 2024 +0100
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Thu Jan 2 11:27:57 2025 -0800

    xen/scripts: Fix regex syntax warnings with Python 3.12
    
    Same fix than commit 826a9eb072 (tools: Fix regex syntax warnings with 
Python 3.12).
    
    It clears out the warning:
    
    ```
    $ xen/scripts/xen-analysis.py
    xen/scripts/xen_analysis/cppcheck_analysis.py:94: SyntaxWarning: invalid 
escape sequence '\*'
      comment_line_starts = re.match('^[ \t]*/\*.*$', line)
    ```
    
    The  warning appears only the first time the command is run, then it 
disappears.
    
    Fixes: 02b26c02c7 (xen/scripts: add cppcheck tool to the xen-analysis.py 
script)
    Signed-off-by: Ariel Otilibili <Ariel.Otilibili-Anieli@xxxxxxxxxx>
    Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
    --
    Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Cc: Michal Orzel <michal.orzel@xxxxxxx>
    Cc: Jan Beulich <jbeulich@xxxxxxxx>
    Cc: Julien Grall <julien@xxxxxxx>
    Cc: "Roger Pau Monné" <roger.pau@xxxxxxxxxx>
    Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/scripts/xen_analysis/cppcheck_analysis.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/scripts/xen_analysis/cppcheck_analysis.py 
b/xen/scripts/xen_analysis/cppcheck_analysis.py
index ce7bda91b6..532a14b0ad 100644
--- a/xen/scripts/xen_analysis/cppcheck_analysis.py
+++ b/xen/scripts/xen_analysis/cppcheck_analysis.py
@@ -91,7 +91,7 @@ def __generate_suppression_list(out_file):
                         line = header_content[tmp_line]
                         # Matches a line with just optional spaces/tabs and the
                         # start of a comment '/*'
-                        comment_line_starts = re.match('^[ \t]*/\*.*$', line)
+                        comment_line_starts = re.match(r'^[ \t]*/\*.*$', line)
                         # Matches a line with text and the end of a comment 
'*/'
                         comment_line_stops = re.match(r'^.*\*/$', line)
                         if (not comment_section) and comment_line_starts:
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.