Re: [gentoo-portage-dev] [PATCH] lib/_emerge/resolver/slot_collision.py: fix redefined-builtin W0622

2020-08-02 Thread Zac Medico
On 8/2/20 7:53 PM, Aaron Bauman wrote:
> * This fixes the referenced warning by renaming the 'id' variable to
>  'name' and the 'type' variable to 'atype'
> * Additional cosmetic/style changes found along the way.
> 
> Signed-off-by: Aaron Bauman 

Thanks, merged with s/atype/ctype/ and s/name/idx/:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=602d2cd487bb48788e9654a7b7fd5a3be34150d9
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


[gentoo-portage-dev] [PATCH] lib/_emerge/resolver/slot_collision.py: fix redefined-builtin W0622

2020-08-02 Thread Aaron Bauman
* This fixes the referenced warning by renaming the 'id' variable to
 'name' and the 'type' variable to 'atype'
* Additional cosmetic/style changes found along the way.

Signed-off-by: Aaron Bauman 
---
 lib/_emerge/resolver/slot_collision.py | 74 +-
 1 file changed, 37 insertions(+), 37 deletions(-)

diff --git a/lib/_emerge/resolver/slot_collision.py 
b/lib/_emerge/resolver/slot_collision.py
index cc16287de..b29d68f2a 100644
--- a/lib/_emerge/resolver/slot_collision.py
+++ b/lib/_emerge/resolver/slot_collision.py
@@ -591,14 +591,14 @@ class slot_conflict_handler:
version_violated = False
slot_violated = False
use = []
-   for (type, sub_type), 
parents in collision_reasons.items():
+   for (atype, sub_type), 
parents in collision_reasons.items():
for x in 
parents:
if 
parent == x[0] and atom == x[1]:
-   
if type == "version":
+   
if atype == "version":

version_violated = True
-   
elif type == "slot":
+   
elif atype == "slot":

slot_violated = True
-   
elif type == "use":
+   
elif atype == "use":

use.append(sub_type)

break
 
@@ -934,64 +934,64 @@ class slot_conflict_handler:
msg += "}"
msg += "]\n"
writemsg(msg, noiselevel=-1)
-   
+
required_changes = {}
-   for id, pkg in enumerate(config):
+   for name, pkg in enumerate(config):
if not pkg.installed:
-   #We can't change the USE of installed packages.
-   for flag in all_involved_flags[id]:
+   # We can't change the USE of installed packages.
+   for flag in all_involved_flags[name]:
if not pkg.iuse.is_valid_flag(flag):
continue
-   state = all_involved_flags[id][flag]
+   state = all_involved_flags[name][flag]

self._force_flag_for_package(required_changes, pkg, flag, state)
 
-   #Go through all (parent, atom) pairs for the current 
slot conflict.
-   for ppkg, atom in all_conflict_atoms_by_slotatom[id]:
+   # Go through all (parent, atom) pairs for the current 
slot conflict.
+   for ppkg, atom in all_conflict_atoms_by_slotatom[name]:
if not atom.package:
continue
use = atom.unevaluated_atom.use
if not use:
-   #No need to force something for an atom 
without USE conditionals.
-   #These atoms are already satisfied.
+   # No need to force something for an 
atom without USE conditionals.
+   # These atoms are already satisfied.
continue
-   for flag in all_involved_flags[id]:
-   state = all_involved_flags[id][flag]
+   for flag in all_involved_flags[name]:
+   state = all_involved_flags[name][flag]

if flag not in use.required or not 
use.conditional:
continue
if flag in use.conditional.enabled:
-   #[flag?]
+