mirror of https://github.com/pypa/pip
Fix bug in InstallRequirement: __str__ could return None
This commit is contained in:
parent
4e018d76e2
commit
ada59afaeb
|
@ -301,8 +301,10 @@ class InstallRequirement(object):
|
||||||
s = str(self.req)
|
s = str(self.req)
|
||||||
if self.link:
|
if self.link:
|
||||||
s += ' from %s' % self.link.url
|
s += ' from %s' % self.link.url
|
||||||
|
elif self.link:
|
||||||
|
s = self.link.url
|
||||||
else:
|
else:
|
||||||
s = self.link.url if self.link else None
|
s = '<InstallRequirement>'
|
||||||
if self.satisfied_by is not None:
|
if self.satisfied_by is not None:
|
||||||
s += ' in %s' % display_path(self.satisfied_by.location)
|
s += ' in %s' % display_path(self.satisfied_by.location)
|
||||||
if self.comes_from:
|
if self.comes_from:
|
||||||
|
|
Loading…
Reference in New Issue