aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2020-07-23 18:06:54 -0700
committerZac Medico <zmedico@gentoo.org>2020-07-23 19:10:43 -0700
commit550727af87d5f646617e0c19a3f3300c8117e7f5 (patch)
tree15223c8c8edeb9d7fe962faccd584c79daf0e14b /lib/_emerge
parentFix extra file. (diff)
downloadportage-550727af87d5f646617e0c19a3f3300c8117e7f5.tar.gz
portage-550727af87d5f646617e0c19a3f3300c8117e7f5.tar.bz2
portage-550727af87d5f646617e0c19a3f3300c8117e7f5.zip
Fix redefined-builtin errors for pylint.
Some of these are simple variable renames. A few of the uses were refactored and some were simply disabled; often due to redefinition as part of a function signature. I did not do any research in terms of API changes so these were typically left as-is. Closes: https://github.com/gentoo/portage/pull/587 Signed-off-by: Alec Warner <antarus@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge')
-rw-r--r--lib/_emerge/actions.py2
-rw-r--r--lib/_emerge/depgraph.py2
-rw-r--r--lib/_emerge/help.py2
-rw-r--r--lib/_emerge/main.py2
-rw-r--r--lib/_emerge/resolver/output_helpers.py2
-rw-r--r--lib/_emerge/resolver/slot_collision.py28
-rw-r--r--lib/_emerge/search.py2
7 files changed, 20 insertions, 20 deletions
diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index 964dca31c..2cbca99d8 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -27,7 +27,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
'portage.util.locale:check_locale',
'portage.emaint.modules.sync.sync:SyncRepos',
'_emerge.chk_updated_cfg_files:chk_updated_cfg_files',
- '_emerge.help:help@emerge_help',
+ '_emerge.help:emerge_help',
'_emerge.post_emerge:display_news_notification,post_emerge',
'_emerge.stdout_spinner:stdout_spinner',
)
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 653348d34..3ff90190d 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -7476,7 +7476,7 @@ class depgraph:
mygraph.order.sort(key=cmp_sort_key(cmp_merge_preference))
- def altlist(self, reversed=DeprecationWarning):
+ def altlist(self, reversed=DeprecationWarning): # pylint: disable=redefined-builtin
if reversed is not DeprecationWarning:
warnings.warn("The reversed parameter of "
diff --git a/lib/_emerge/help.py b/lib/_emerge/help.py
index 2ccd323aa..de3d7b593 100644
--- a/lib/_emerge/help.py
+++ b/lib/_emerge/help.py
@@ -5,7 +5,7 @@ from __future__ import print_function
from portage.output import bold, turquoise, green
-def help():
+def emerge_help():
print(bold("emerge:")+" command-line interface to the Portage system")
print(bold("Usage:"))
print(" "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] [ "+turquoise("ebuild")+" | "+turquoise("tbz2")+" | "+turquoise("file")+" | "+turquoise("@set")+" | "+turquoise("atom")+" ] [ ... ]")
diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py
index 69d93f846..8228e0b41 100644
--- a/lib/_emerge/main.py
+++ b/lib/_emerge/main.py
@@ -16,7 +16,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
'textwrap',
'_emerge.actions:load_emerge_config,run_action,' + \
'validate_ebuild_environment',
- '_emerge.help:help@emerge_help',
+ '_emerge.help:emerge_help',
'_emerge.is_valid_package_atom:insert_category_into_atom'
)
from portage import os
diff --git a/lib/_emerge/resolver/output_helpers.py b/lib/_emerge/resolver/output_helpers.py
index d5cc9dbcb..25aa925b4 100644
--- a/lib/_emerge/resolver/output_helpers.py
+++ b/lib/_emerge/resolver/output_helpers.py
@@ -469,7 +469,7 @@ def _prune_tree_display(display_list):
del display_list[i]
-def _calc_changelog(ebuildpath,current,next):
+def _calc_changelog(ebuildpath,current,next): # pylint: disable=redefined-builtin
if ebuildpath == None or not os.path.exists(ebuildpath):
return []
current = '-'.join(catpkgsplit(current)[1:])
diff --git a/lib/_emerge/resolver/slot_collision.py b/lib/_emerge/resolver/slot_collision.py
index 49034ee8f..05f4256ad 100644
--- a/lib/_emerge/resolver/slot_collision.py
+++ b/lib/_emerge/resolver/slot_collision.py
@@ -371,11 +371,11 @@ class slot_conflict_handler:
selected_for_display = set()
unconditional_use_deps = set()
- for (type, sub_type), parents in collision_reasons.items():
- #From each (type, sub_type) pair select at least one atom.
+ for (ctype, sub_type), parents in collision_reasons.items():
+ #From each (ctype, sub_type) pair select at least one atom.
#Try to select as few atoms as possible
- if type == "version":
+ if ctype == "version":
#Find the atom with version that is as far away as possible.
best_matches = {}
for ppkg, atom, other_pkg in parents:
@@ -395,7 +395,7 @@ class slot_conflict_handler:
if not verboseconflicts:
selected_for_display.update(
best_matches.values())
- elif type in ("soname", "slot"):
+ elif ctype in ("soname", "slot"):
# Check for packages that might need to
# be rebuilt, but cannot be rebuilt for
# some reason.
@@ -423,7 +423,7 @@ class slot_conflict_handler:
selected_for_display.add((ppkg, atom))
if not verboseconflicts:
break
- elif type == "use":
+ elif ctype == "use":
#Prefer atoms with unconditional use deps over, because it's
#not possible to change them on the parent, which means there
#are fewer possible solutions.
@@ -464,7 +464,7 @@ class slot_conflict_handler:
# If the list is long, people can simply
# use a pager.
selected_for_display.add((ppkg, atom))
- elif type == "AtomArg":
+ elif ctype == "AtomArg":
for ppkg, atom in parents:
selected_for_display.add((ppkg, atom))
@@ -736,9 +736,9 @@ class slot_conflict_handler:
all_involved_flags = []
#Go through all slot conflicts
- for id, pkg in enumerate(config):
+ for idx, pkg in enumerate(config):
involved_flags = {}
- for ppkg, atom in all_conflict_atoms_by_slotatom[id]:
+ for ppkg, atom in all_conflict_atoms_by_slotatom[idx]:
if not atom.package:
continue
@@ -846,8 +846,8 @@ class slot_conflict_handler:
if self.debug:
writemsg("All involved flags:\n", noiselevel=-1)
- for id, involved_flags in enumerate(all_involved_flags):
- writemsg(" %s\n" % (config[id],), noiselevel=-1)
+ for idx, involved_flags in enumerate(all_involved_flags):
+ writemsg(" %s\n" % (config[idx],), noiselevel=-1)
for flag, state in involved_flags.items():
writemsg(" " + flag + ": " + state + "\n", noiselevel=-1)
@@ -1095,11 +1095,11 @@ class _configuration_generator:
return None
solution = []
- for id, pkgs in enumerate(self.conflict_pkgs):
- solution.append(pkgs[self.solution_ids[id]])
+ for idx, pkgs in enumerate(self.conflict_pkgs):
+ solution.append(pkgs[self.solution_ids[idx]])
return solution
- def _next(self, id=None):
+ def _next(self, id=None): # pylint: disable=redefined-builtin
solution_ids = self.solution_ids
conflict_pkgs = self.conflict_pkgs
@@ -1160,7 +1160,7 @@ class _solution_candidate_generator:
return self.all_involved_flags
- def _next(self, id=None):
+ def _next(self, id=None): # pylint: disable=redefined-builtin
values = self.conditional_values
if not values:
diff --git a/lib/_emerge/search.py b/lib/_emerge/search.py
index 14d7e3562..000c427e0 100644
--- a/lib/_emerge/search.py
+++ b/lib/_emerge/search.py
@@ -409,7 +409,7 @@ class search:
desc = metadata["DESCRIPTION"]
homepage = metadata["HOMEPAGE"]
- license = metadata["LICENSE"]
+ license = metadata["LICENSE"] # pylint: disable=redefined-builtin
if masked:
msg.append(green("*") + " " + \