Fix bug in InstallRequirement: __str__ could return None

This commit is contained in:
Paul Moore 2018-08-04 08:50:35 +01:00
parent 4e018d76e2
commit ada59afaeb
1 changed files with 3 additions and 1 deletions

View File

@ -301,8 +301,10 @@ class InstallRequirement(object):
s = str(self.req)
if self.link:
s += ' from %s' % self.link.url
elif self.link:
s = self.link.url
else:
s = self.link.url if self.link else None
s = '<InstallRequirement>'
if self.satisfied_by is not None:
s += ' in %s' % display_path(self.satisfied_by.location)
if self.comes_from: