detect virtualenvs better

Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2017-09-24 19:21:27 -04:00
parent 531e96cec0
commit 3d4d4c36ce
+6 -1
View File
@@ -74,7 +74,12 @@ class Project(object):
def virtualenv_exists(self):
# TODO: Decouple project from existence of Pipfile.
if self.pipfile_exists:
return os.path.isdir(self.virtualenv_location)
if os.name == 'nt':
extra = ['Scripts', 'activate.bat']
else:
extra = ['bin', 'activate']
return os.path.isfile(os.sep.join([self.virtualenv_location] + extra))
return False
@property