diff --git a/src/pip/_internal/operations/check.py b/src/pip/_internal/operations/check.py index 184676550c7..e904309c90c 100644 --- a/src/pip/_internal/operations/check.py +++ b/src/pip/_internal/operations/check.py @@ -62,9 +62,7 @@ def check_package_set(package_set, should_ignore=None): package name and returns a boolean. """ if should_ignore: - should_ignore_package = should_ignore - else: - def should_ignore_package(name): + def should_ignore(name): # type: (str) -> bool return False @@ -76,7 +74,7 @@ def should_ignore_package(name): missing_deps = set() # type: Set[Missing] conflicting_deps = set() # type: Set[Conflicting] - if should_ignore_package(package_name): + if should_ignore and should_ignore(package_name): continue for req in package_set[package_name].requires: