From: Bruno Haible Date: Sat, 13 Apr 2024 11:30:44 +0000 (+0200) Subject: gnulib-tool.py: Code tweak. X-Git-Tag: v1.0~100 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=172b9afb877e167b6f0d23a434a7289e25b724d1;p=gnulib.git gnulib-tool.py: Code tweak. * pygnulib/main.py (main): Move file contents analysis out of a 'with' statement. --- diff --git a/ChangeLog b/ChangeLog index adea7603ec..c72165e268 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-04-13 Bruno Haible + + gnulib-tool.py: Code tweak. + * pygnulib/main.py (main): Move file contents analysis out of a 'with' + statement. + 2024-04-13 Bruno Haible gnulib-tool.py: Stop using codecs.open. diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index 02a49f8512..d44ceedcec 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -99,7 +99,7 @@ class GLImport: with open(self.config.getAutoconfFile(), mode='r', newline='\n', encoding='utf-8') as file: data = file.read() - # Get cached auxdir and libtool from configure.{ac,in}. + # Get cached auxdir from configure.{ac,in}. self.cache.setAuxDir('.') pattern = re.compile(r'^AC_CONFIG_AUX_DIR\([\[ ]*([^]"$`\\)]+).*?$', re.MULTILINE) match = pattern.search(data) diff --git a/pygnulib/main.py b/pygnulib/main.py index 5875618941..b24db139b5 100644 --- a/pygnulib/main.py +++ b/pygnulib/main.py @@ -990,8 +990,8 @@ def main() -> None: if isfile(filepath): with open(filepath, mode='r', newline='\n', encoding='utf-8') as file: data = file.read() - data = data.split('ACLOCAL_AMFLAGS')[1] - data = data[data.find('=') + 1:data.find('\n')] + data = data.split('ACLOCAL_AMFLAGS')[1] + data = data[data.find('=') + 1 : data.find('\n')] aclocal_amflags = data.split() for aclocal_amflag in aclocal_amflags: if dirisnext: