From: Bruno Haible Date: Mon, 11 Mar 2024 12:27:30 +0000 (+0100) Subject: gnulib-tool.py: Tweak last commit. X-Git-Tag: v1.0~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f55338d6a971efadfa4e367ce094b2e70b336499;p=thirdparty%2Fgnulib.git gnulib-tool.py: Tweak last commit. * pygnulib/GLEmiter.py (_eliminate_NMD): Don't add an extra newline when the result should be empty. --- diff --git a/ChangeLog b/ChangeLog index cf09ef2da4..1210f53511 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-03-11 Bruno Haible + + gnulib-tool.py: Tweak last commit. + * pygnulib/GLEmiter.py (_eliminate_NMD): Don't add an extra newline when + the result should be empty. + 2024-03-11 Collin Funk gnulib-tool.py: Follow gnulib-tool changes, part 53. diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index f0ae4627e6..11f1a2c9fc 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -13,7 +13,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Allow the use of union type specifiers, using the syntax Type1 | Type2, +# in Python ≥ 3.7. Cf. +# and . from __future__ import annotations + #=============================================================================== # Define global imports #=============================================================================== @@ -84,7 +88,10 @@ def _eliminate_NMD(snippet: str, automake_subdir: bool) -> str: line = _eliminate_NMD_from_line(line, automake_subdir) if line != None: result.append(line) - return '\n'.join(result) + '\n' + if len(result) > 0: + return '\n'.join(result) + '\n' + else: + return '' #===============================================================================