Skip to content

Commit

Permalink
Raise explicit exception for wrong which context
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Jul 5, 2018
1 parent ac16274 commit 9997611
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9997611

Please sign in to comment.