[Python-checkins] bpo-44786: Fix a warning in RE in c-analyzer (GH-28351) (GH-28353)

serhiy-storchaka webhook-mailer at python.org
Wed Sep 15 12:43:30 EDT 2021


https://github.com/python/cpython/commit/89966f59c2e1d0558f8126458acc7d7ae2a8fef5
commit: 89966f59c2e1d0558f8126458acc7d7ae2a8fef5
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2021-09-15T19:43:25+03:00
summary:

bpo-44786: Fix a warning in RE in c-analyzer (GH-28351) (GH-28353)

(cherry picked from commit 1a9ef5798525bbb39a16c8af5c435b97352ee027)

Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>

files:
A Misc/NEWS.d/next/Tools-Demos/2021-09-14-11-44-26.bpo-44786.DU0LC0.rst
M Tools/c-analyzer/c_common/tables.py

diff --git a/Misc/NEWS.d/next/Tools-Demos/2021-09-14-11-44-26.bpo-44786.DU0LC0.rst b/Misc/NEWS.d/next/Tools-Demos/2021-09-14-11-44-26.bpo-44786.DU0LC0.rst
new file mode 100644
index 0000000000000..96ebf2c33cc5a
--- /dev/null
+++ b/Misc/NEWS.d/next/Tools-Demos/2021-09-14-11-44-26.bpo-44786.DU0LC0.rst
@@ -0,0 +1 @@
+Fix a warning in regular expression in the c-analyzer script.
diff --git a/Tools/c-analyzer/c_common/tables.py b/Tools/c-analyzer/c_common/tables.py
index 85b501925715d..130be6beba5f8 100644
--- a/Tools/c-analyzer/c_common/tables.py
+++ b/Tools/c-analyzer/c_common/tables.py
@@ -236,12 +236,12 @@ def build_table(specs, *, sep=' ', defaultwidth=None):
 _COLSPEC_RE = re.compile(textwrap.dedent(r'''
     ^
     (?:
-        [[]
+        \[
         (
             (?: [^\s\]] [^\]]* )?
             [^\s\]]
         )  # <label>
-        []]
+        ]
     )?
     ( \w+ )  # <field>
     (?:



More information about the Python-checkins mailing list