]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Code tweak.
authorBruno Haible <bruno@clisp.org>
Sat, 13 Apr 2024 11:30:44 +0000 (13:30 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 13 Apr 2024 11:30:44 +0000 (13:30 +0200)
* pygnulib/main.py (main): Move file contents analysis out of a 'with'
statement.

ChangeLog
pygnulib/GLImport.py
pygnulib/main.py

index adea7603ecc2ba35a8323da1e3a66f3f1ee09761..c72165e268403c713efc23becc02473fe5fdb8fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-04-13  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool.py: Code tweak.
+       * pygnulib/main.py (main): Move file contents analysis out of a 'with'
+       statement.
+
 2024-04-13  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool.py: Stop using codecs.open.
index 02a49f851254096652ca79a490303005108ad2c0..d44ceedcecaf1f13a7e440af74bd440e21f71d3e 100644 (file)
@@ -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)
index 587561894125f9adc23a0c8b522f10f589fb17d3..b24db139b54b4d37084a86a667de539306f3b7c4 100644 (file)
@@ -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: