diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2023-03-22 17:59:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-22 07:59:32 -0700 |
commit | 1ca315538f2f9da6c7b86c4c46e76d454c1ec4b9 (patch) | |
tree | 29dd93839c113c31081b10a23efaefa97f2c1a6d /Tools/c-analyzer/cpython/_capi.py | |
parent | 7559f5fda94ab568a1a910b17683ed81dc3426fb (diff) | |
download | cpython-git-1ca315538f2f9da6c7b86c4c46e76d454c1ec4b9.tar.gz |
gh-102033: Fix syntax error in `Tools/c-analyzer` (GH-102066)
The easiest way to format strings with `{}` meaningful chars is via `%`.
Diffstat (limited to 'Tools/c-analyzer/cpython/_capi.py')
-rw-r--r-- | Tools/c-analyzer/cpython/_capi.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Tools/c-analyzer/cpython/_capi.py b/Tools/c-analyzer/cpython/_capi.py index df8159a8cc..4552f71479 100644 --- a/Tools/c-analyzer/cpython/_capi.py +++ b/Tools/c-analyzer/cpython/_capi.py @@ -7,7 +7,7 @@ import textwrap from c_common.tables import build_table, resolve_columns from c_parser.parser._regexes import _ind -from ._files import iter_header_files, resolve_filename +from ._files import iter_header_files from . import REPO_ROOT @@ -610,8 +610,7 @@ def _render_item_full(item, groupby, verbose): yield item.name yield f' {"filename:":10} {item.relfile}' for extra in ('kind', 'level'): - #if groupby != extra: - yield f' {extra+":":10} {getattr(item, extra)}' + yield f' {extra+":":10} {getattr(item, extra)}' if verbose: print(' ---------------------------------------') for lno, line in enumerate(item.text, item.lno): @@ -636,7 +635,6 @@ def render_summary(items, *, subtotals = summary['totals']['subs'] bygroup = summary['totals']['bygroup'] - lastempty = False for outer, subtotal in subtotals.items(): if bygroup: subtotal = f'({subtotal})' @@ -646,10 +644,6 @@ def render_summary(items, *, if outer in bygroup: for inner, count in bygroup[outer].items(): yield f' {inner + ":":9} {count}' - lastempty = False - else: - lastempty = True - total = f'*{summary["totals"]["all"]}*' label = '*total*:' if bygroup: |