Skip to content

Commit

Permalink
Catch errors parsing requirements to check packages
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Oct 2, 2018
1 parent b6bbabe commit cfac80f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pip/_internal/operations/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from collections import namedtuple

from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.pkg_resources import RequirementParseError

from pip._internal.operations.prepare import make_abstract_dist
from pip._internal.utils.misc import get_installed_distributions
Expand Down Expand Up @@ -38,7 +39,11 @@ def create_package_set_from_installed(**kwargs):
package_set = {}
for dist in get_installed_distributions(**kwargs):
name = canonicalize_name(dist.project_name)
package_set[name] = PackageDetails(dist.version, dist.requires())
try:
package_set[name] = PackageDetails(dist.version, dist.requires())
except RequirementParseError:
# Don't crash on broken metadata
pass # TODO: log a warning?
return package_set


Expand Down

0 comments on commit cfac80f

Please sign in to comment.