mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
pip: Fix uninitialized variable during check_mode (#4379)
During check_mode (`--check`), the variable change could be used uninitialized, yielding this error: `UnboundLocalError: local variable 'changed' referenced before assignment` This changeset simply initializes it to False.
This commit is contained in:
parent
3a44d60fbc
commit
7b66bdc1c4
1 changed files with 1 additions and 0 deletions
|
@ -410,6 +410,7 @@ def main():
|
|||
out += out_pip
|
||||
err += err_pip
|
||||
|
||||
changed = False
|
||||
if name:
|
||||
for pkg in name:
|
||||
is_present = _is_present(pkg, version, out.split())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue