[Python-checkins] bpo-44786: Fix a warning in RE in c-analyzer (GH-28351)
serhiy-storchaka
webhook-mailer at python.org
Wed Sep 15 10:08:56 EDT 2021
https://github.com/python/cpython/commit/1a9ef5798525bbb39a16c8af5c435b97352ee027
commit: 1a9ef5798525bbb39a16c8af5c435b97352ee027
branch: main
author: Serhiy Storchaka <storchaka at gmail.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2021-09-15T17:08:48+03:00
summary:
bpo-44786: Fix a warning in RE in c-analyzer (GH-28351)
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