fallback to a placeholder in case dist.location is None
# The following comment should be removed at some point in the future.
-# mypy: strict-optional=False
import functools
import logging
@@ -195,7 +194,11 @@ class InstallRequirement:
else:
s = "<InstallRequirement>"
if self.satisfied_by is not None:
- s += " in {}".format(display_path(self.satisfied_by.location))
+ if self.satisfied_by.location is not None:
+ location = display_path(self.satisfied_by.location)
+ else:
+ location = 'memory'
+ s += f" in {location}"
if self.comes_from:
if isinstance(self.comes_from, str):
comes_from: Optional[str] = self.comes_from
