+2024-04-05 Collin Funk <collin.funk1@gmail.com>
+
+ gnulib-tool.py: Fix 'consider-using-set-comprehension' warnings.
+ * pygnulib/GLImport.py (GLImport.prepare): Create a set directly instead
+ of creating a list and passing it to a call of set().
+ (GLImport.__init__): Likewise. Use max() instead of getting the last
+ element of a sorted list.
+
2024-04-05 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Fix 'consider-using-with' pylint warnings.
pattern = re.compile(r'.*AC_PREREQ\((.*)\)', re.M)
versions = cleaner(pattern.findall(data))
if versions:
- version = sorted(set([ float(version)
- for version in versions ]))[-1]
+ version = max({ float(version)
+ for version in versions })
self.config.setAutoconfVersion(version)
if version < 2.64:
raise GLError(4, version)
m4base = self.config['m4base']
lgpl = self.config['lgpl']
verbose = self.config['verbosity']
- base_modules = sorted(set([ self.modulesystem.find(m)
- for m in modules ]))
+ base_modules = sorted({ self.modulesystem.find(m)
+ for m in modules })
# Perform transitive closure.
final_modules = self.moduletable.transitive_closure(base_modules)