]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gnulib-tool.py: Fix 'consider-using-with' pylint warnings.
authorCollin Funk <collin.funk1@gmail.com>
Fri, 5 Apr 2024 03:32:55 +0000 (20:32 -0700)
committerBruno Haible <bruno@clisp.org>
Fri, 5 Apr 2024 12:50:45 +0000 (14:50 +0200)
* pygnulib/GLModuleSystem.py (GLModuleSystem.list): Use run() instead of
Popen() from the subprocess module. This function handles cleanup
internally instead of as a context manager via the 'with' statement.

ChangeLog
pygnulib/GLModuleSystem.py

index 65ef87e264baf28a04ad1820e0ca549b4d2049c2..390d8071abace45a314205d741f5e1a683c81d7a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-04-05  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Fix 'consider-using-with' pylint warnings.
+       * pygnulib/GLModuleSystem.py (GLModuleSystem.list): Use run() instead of
+       Popen() from the subprocess module. This function handles cleanup
+       internally instead of as a context manager via the 'with' statement.
+
 2024-04-05  Bruno Haible  <bruno@clisp.org>
 
        Update for NetBSD 9.3 and 10.0.
index 1f5d536fe3b51c266050f5bdb4caef901de148a6..98a21c4696f84520e0c2c7ecbaedacec3e753c50 100644 (file)
@@ -136,16 +136,14 @@ class GLModuleSystem:
 
         # Read modules from gnulib root directory.
         os.chdir(constants.DIRS['root'])
-        find = sp.Popen(find_args, stdout=sp.PIPE)
-        result += find.stdout.read().decode("UTF-8")
+        result += sp.run(find_args, text=True, capture_output=True, check=False).stdout
         os.chdir(DIRS['cwd'])
 
         # Read modules from local directories.
         if len(localpath) > 0:
             for localdir in localpath:
                 os.chdir(localdir)
-                find = sp.Popen(find_args, stdout=sp.PIPE)
-                result += find.stdout.read().decode("UTF-8")
+                result += sp.run(find_args, text=True, capture_output=True, check=False).stdout
                 os.chdir(DIRS['cwd'])
 
         listing = [ line