mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-07-29 15:55:47 -05:00
pylint3: workaround false positives reported for W1662
Pylint3 falsely reports warning W1662: using a variable that was bound
inside a comprehension for the cases where the same name is reused for a
loop after the comprehension in question.
Rename the variable in a loop to avoid it.
If the code looks like the following:
arr = [f for f in filters if callable(f)]
for f in arr:
result = result + f()
pylint3 would consider 'f' used outside of comprehension. Clearly, this
is a false-positive warning as the second 'f' use is completely
independent of the comprehension's use of 'f'.
Reviewed-By: Aleksei Slaikovskii <aslaikov@redhat.com>
This commit is contained in:
committed by
Rob Crittenden
parent
a0eaa74234
commit
c61151f6aa
@@ -496,7 +496,7 @@ def run(args, stdin=None, raiseonerr=True, nolog=(), env=None,
|
||||
pent = pwd.getpwnam(runas)
|
||||
|
||||
suplementary_gids = [
|
||||
grp.getgrnam(group).gr_gid for group in suplementary_groups
|
||||
grp.getgrnam(sgroup).gr_gid for sgroup in suplementary_groups
|
||||
]
|
||||
|
||||
logger.debug('runas=%s (UID %d, GID %s)', runas,
|
||||
|
||||
Reference in New Issue
Block a user