diff options
author | Alexander Bokovoy <[email protected]> | 2018-05-17 17:49:27 +0300 |
---|---|---|
committer | Rob Crittenden <[email protected]> | 2018-05-17 16:55:42 -0400 |
commit | c61151f6aa0c033834aed70561fc762c06176555 (patch) | |
tree | a64b1100605e338329092db7942a6dbc9b4709ac /ipalib | |
parent | a0eaa742343de194ecef2ff7c9e3c74e7f35f51f (diff) | |
download | freeipa-c61151f6aa0c033834aed70561fc762c06176555.tar.gz freeipa-c61151f6aa0c033834aed70561fc762c06176555.tar.xz freeipa-c61151f6aa0c033834aed70561fc762c06176555.zip |
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 <[email protected]>
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugable.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 758b67cd7..d78a60712 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -638,7 +638,7 @@ class API(ReadOnly): logger.debug("importing all plugin modules in %s...", package_name) modules = getattr(package, 'modules', find_modules_in_dir(package_dir)) - modules = ['.'.join((package_name, name)) for name in modules] + modules = ['.'.join((package_name, mname)) for mname in modules] for name in modules: logger.debug("importing plugin module %s", name) |