[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnulib-tool.py: Don't emit empty Automake snippets.
From: |
Collin Funk |
Subject: |
Re: [PATCH] gnulib-tool.py: Don't emit empty Automake snippets. |
Date: |
Wed, 20 Mar 2024 01:00:13 -0700 |
User-agent: |
Mozilla Thunderbird |
Hi Bruno,
On 3/19/24 3:00 AM, Bruno Haible wrote:
> ... which tests whether the combination of the two snippets contains some
> character that is not newline, not space, and not tab.
I think I found the reason that these lines are printed. Apparently
str.isspace() will return False for empty strings:
print('\t'.isspace())
True
print('\n'.isspace())
True
print(''.isspace())
False
With these lines added before the check:
+ if (amsnippet1 + amsnippet2) == '':
+ print('EMPTY:')
+ print(str(module))
And running the Emacs script again:
$ env GNULIB_TOOL_IMPL=py ./admin/merge-gnulib | grep -A2 EMPTY:
EMPTY:
manywarnings
EMPTY:
warnings
Which matches the added lines in the diff. I've changed those
conditions to the following:
if (amsnippet1 + amsnippet2).strip() != '':
Collin
0001-gnulib-tool.py-Don-t-print-empty-Automake-snippets.patch
Description: Text Data
- [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 65., Collin Funk, 2024/03/18
- Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 67., Bruno Haible, 2024/03/19
- Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 67., Collin Funk, 2024/03/19
- Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 67., Bruno Haible, 2024/03/19
- Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 67., Collin Funk, 2024/03/19
- Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 67., Bruno Haible, 2024/03/19
- Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 67., Bruno Haible, 2024/03/20
Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 66., Bruno Haible, 2024/03/19
Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 65., Bruno Haible, 2024/03/19