mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Remove NoneType resuts from dist search
Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
+10
-7
@@ -307,17 +307,20 @@ class Project(object):
|
||||
if not location:
|
||||
return dist.location
|
||||
|
||||
def dist_is_in_project(self, dist):
|
||||
prefix = _normalized(self.env_paths["prefix"])
|
||||
location = self.locate_dist(dist)
|
||||
if not location:
|
||||
return False
|
||||
return _normalized(location).startswith(prefix)
|
||||
|
||||
def get_installed_packages(self):
|
||||
workingset = self.working_set
|
||||
prefix = _normalized(self.env_paths["prefix"])
|
||||
if self.virtualenv_exists:
|
||||
packages = [
|
||||
pkg for pkg in workingset
|
||||
if _normalized(self.locate_dist(pkg)).startswith(prefix)
|
||||
]
|
||||
return packages
|
||||
packages = [pkg for pkg in workingset if self.dist_is_in_project(pkg)]
|
||||
else:
|
||||
return [pkg for pkg in packages]
|
||||
packages = [pkg for pkg in packages]
|
||||
return packages
|
||||
|
||||
@classmethod
|
||||
def _sanitize(cls, name):
|
||||
|
||||
Reference in New Issue
Block a user