mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Raise explicit exception for wrong which context
This commit is contained in:
+2
-1
@@ -106,7 +106,8 @@ def which(command, location=None, allow_global=False):
|
||||
project.virtualenv_location
|
||||
or os.environ.get("VIRTUAL_ENV", "")
|
||||
)
|
||||
assert location and os.path.exists(location), "virtualenv not created"
|
||||
if not location and os.path.exists(location):
|
||||
raise RuntimeError("virtualenv not created nor specified")
|
||||
if not allow_global:
|
||||
if os.name == "nt":
|
||||
p = find_windows_executable(os.path.join(location, "Scripts"), command)
|
||||
|
||||
Reference in New Issue
Block a user