Use try-else inside _evaluate_link().
@@ -365,12 +365,13 @@ class CandidateEvaluator(object):
except specifiers.InvalidSpecifier:
logger.debug("Package %s has an invalid Requires-Python entry: %s",
link.filename, link.requires_python)
- support_this_python = True
-
+ else:
if not support_this_python:
- logger.debug("The package %s is incompatible with the python "
+ logger.debug(
+ "The package %s is incompatible with the python "
"version in use. Acceptable python versions are: %s",
- link, link.requires_python)
+ link, link.requires_python,
+ )
# Return None for the reason text to suppress calling
# _log_skipped_link().
return (False, None)
