Skip to content

Commit

Permalink
Add WSL path conversion in venv activate script
Browse files Browse the repository at this point in the history
Signed-off-by: y5c4l3 <[email protected]>
  • Loading branch information
y5c4l3 committed Sep 19, 2024
1 parent 4420cf4 commit c2d2b43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Lib/venv/scripts/common/activate
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,17 @@ case "$(uname)" in
export VIRTUAL_ENV
;;
*)
# use the path as-is
export VIRTUAL_ENV="__VENV_DIR__"
case "$(uname -r)" in
*Microsoft*|*WSL*)
# convert path to /mnt/d/path/to/venv on WSL
VIRTUAL_ENV=$(wslpath "__VENV_DIR__")
export VIRTUAL_ENV
;;
*)
# use the path as-is
export VIRTUAL_ENV="__VENV_DIR__"
;;
esac
;;
esac

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add WSL path conversion in :mod:`venv` ``activate`` script.

0 comments on commit c2d2b43

Please sign in to comment.