Commit df98fd28 by Mykhailo Panarin Committed by Sébastien Eustace

[FIX] activation of venv, when `.venv` is a file (#1054)

Some programs (ex. Emacs with auto-virtualenvwrapper package) uses
.venv file to auto-determine the virtualenv of the project. Which is
pretty handy. As well as, it doesn't make sense inside a poetry to
try to set the venv, when it is a file.
parent 1ba6be8b
...@@ -188,7 +188,7 @@ class Env(object): ...@@ -188,7 +188,7 @@ class Env(object):
if not in_venv: if not in_venv:
# Checking if a local virtualenv exists # Checking if a local virtualenv exists
if (cwd / ".venv").exists(): if (cwd / ".venv").exists() and (cwd / ".venv").is_dir():
venv = cwd / ".venv" venv = cwd / ".venv"
return VirtualEnv(venv) return VirtualEnv(venv)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment