Skip to content

Commit

Permalink
fix: don't crash if currently not in a venv
Browse files Browse the repository at this point in the history
  • Loading branch information
robinvandernoord committed Feb 29, 2024
1 parent da9e48e commit cd480e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uvx/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def virtualenv(virtualenv_dir: Path | str) -> typing.Generator[Path, None, None]

virtualenv_bin_dir = str((virtualenv_dir / "bin").resolve())
new_path = "{}:{}".format(virtualenv_bin_dir, old_path)
old_env = local.env["VIRTUAL_ENV"]
old_env = local.env.get("VIRTUAL_ENV")
new_env = str(virtualenv_dir)
local.env["PATH"] = new_path
local.env["VIRTUAL_ENV"] = new_env
Expand Down

0 comments on commit cd480e3

Please sign in to comment.