Skip to content

Commit

Permalink
Allow identical VIRTUAL_ENV and CONDA_PREFIX env vars (#1879)
Browse files Browse the repository at this point in the history
* Allow identical `VIRTUAL_ENV` and `CONDA_PREFIX` env vars

Fixes #1878

* cargo fmt

---------

Co-authored-by: messense <[email protected]>
  • Loading branch information
konstin and messense authored Dec 12, 2023
1 parent 2531f33 commit 7dfb268
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ fn detect_venv(target: &Target) -> Result<PathBuf> {
match (env::var_os("VIRTUAL_ENV"), env::var_os("CONDA_PREFIX")) {
(Some(dir), None) => return Ok(PathBuf::from(dir)),
(None, Some(dir)) => return Ok(PathBuf::from(dir)),
(Some(venv), Some(conda)) if venv == conda => return Ok(PathBuf::from(venv)),
(Some(_), Some(_)) => {
bail!("Both VIRTUAL_ENV and CONDA_PREFIX are set. Please unset one of them")
}
Expand Down

0 comments on commit 7dfb268

Please sign in to comment.