diff --git a/pylib/gyp/generator/android.py b/pylib/gyp/generator/android.py index 7dbbd579..3ac61008 100644 --- a/pylib/gyp/generator/android.py +++ b/pylib/gyp/generator/android.py @@ -981,9 +981,9 @@ def WriteList( """ values = "" if value_list: - value_list = [quoter(prefix + l) for l in value_list] + value_list = [quoter(prefix + value) for value in value_list] if local_pathify: - value_list = [self.LocalPathify(l) for l in value_list] + value_list = [self.LocalPathify(value) for value in value_list] values = " \\\n\t" + " \\\n\t".join(value_list) self.fp.write("%s :=%s\n\n" % (variable, values)) diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index 4a50b043..01f4ed35 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -1944,7 +1944,7 @@ def WriteList(self, value_list, variable=None, prefix="", quoter=QuoteIfNecessar """ values = "" if value_list: - value_list = [quoter(prefix + l) for l in value_list] + value_list = [quoter(prefix + value) for value in value_list] values = " \\\n\t" + " \\\n\t".join(value_list) self.fp.write("%s :=%s\n\n" % (variable, values)) diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py index 19e00319..40d8591f 100644 --- a/pylib/gyp/generator/ninja.py +++ b/pylib/gyp/generator/ninja.py @@ -1481,16 +1481,18 @@ def WriteLinkForArch( library_dirs = config.get("library_dirs", []) if self.flavor == "win": library_dirs = [ - self.msvs_settings.ConvertVSMacros(l, config_name) for l in library_dirs + self.msvs_settings.ConvertVSMacros(library_dir, config_name) + for library_dir in library_dirs ] library_dirs = [ - "/LIBPATH:" + QuoteShellArgument(self.GypPathToNinja(l), self.flavor) - for l in library_dirs + "/LIBPATH:" + + QuoteShellArgument(self.GypPathToNinja(library_dir), self.flavor) + for library_dir in library_dirs ] else: library_dirs = [ - QuoteShellArgument("-L" + self.GypPathToNinja(l), self.flavor) - for l in library_dirs + QuoteShellArgument("-L" + self.GypPathToNinja(library_dir), self.flavor) + for library_dir in library_dirs ] libraries = gyp.common.uniquer( diff --git a/pylib/gyp/input.py b/pylib/gyp/input.py index 139df754..00c4ee1f 100644 --- a/pylib/gyp/input.py +++ b/pylib/gyp/input.py @@ -1619,10 +1619,10 @@ def ExpandWildcardDependencies(targets, data): index = index + 1 -def Unify(l): - """Removes duplicate elements from l, keeping the first element.""" +def Unify(items): + """Removes duplicate elements from items, keeping the first element.""" seen = {} - return [seen.setdefault(e, e) for e in l if e not in seen] + return [seen.setdefault(e, e) for e in items if e not in seen] def RemoveDuplicateDependencies(targets): @@ -1635,10 +1635,10 @@ def RemoveDuplicateDependencies(targets): target_dict[dependency_key] = Unify(dependencies) -def Filter(l, item): - """Removes item from l.""" +def Filter(items, item): + """Removes item from items.""" res = {} - return [res.setdefault(e, e) for e in l if e != item] + return [res.setdefault(e, e) for e in items if e != item] def RemoveSelfDependencies(targets): @@ -2242,11 +2242,11 @@ def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True): def is_hashable(val): return val.__hash__ - # If x is hashable, returns whether x is in s. Else returns whether x is in l. - def is_in_set_or_list(x, s, l): + # If x is hashable, returns whether x is in s. Else returns whether x is in items. + def is_in_set_or_list(x, s, items): if is_hashable(x): return x in s - return x in l + return x in items prepend_index = 0 diff --git a/setup.py b/setup.py index 0781c591..1876aef1 100755 --- a/setup.py +++ b/setup.py @@ -27,18 +27,18 @@ entry_points={"console_scripts": ["gyp=gyp:script_main"]}, python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", classifiers=[ - 'Development Status :: 3 - Alpha', - 'Environment :: Console', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', - 'Natural Language :: English', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", ], ) diff --git a/test_gyp.py b/test_gyp.py index 5975f8d4..382e7527 100755 --- a/test_gyp.py +++ b/test_gyp.py @@ -229,8 +229,7 @@ def run_test(self, test, fmt, i): and not (stdout.endswith("NO RESULT\n")) ): print() - for l in stdout.splitlines(): - print(" %s" % l) + print("\n".join(" %s" % line for line in stdout.splitlines())) elif not self.isatty: print()