From b5ad8b83be21fd8293c08141e4cf5413ca518859 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 10 Aug 2016 17:45:54 -0400 Subject: [PATCH] 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. --- packaging/language/pip.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/language/pip.py b/packaging/language/pip.py index d7f832f0924..466c7ea8875 100755 --- a/packaging/language/pip.py +++ b/packaging/language/pip.py @@ -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())